Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix withResponse() to respect the original method #62

Merged
merged 1 commit into from
Sep 21, 2022

Conversation

briancordanyoung
Copy link

The withResponse<T>(_ type: T.Type) -> Request<T> method carries the comment:

Changes the response type keeping the rest of the request parameters.

Based on this I assume I ran in to a bug — because the request method may also be altered.

withResponse uses a private Initializer to create copy of the request with the updated return type. This initializer ignores the given method parameter and always sets the request to use the .get method.

This PR also includes a comment spelling fix.

@briancordanyoung briancordanyoung changed the title Fix withResponse() to respect method Fix withResponse() to respect the original method Sep 21, 2022
@kean
Copy link
Owner

kean commented Sep 21, 2022

Thanks! Yes, that's clearly a defect.

@kean kean merged commit 7092931 into kean:main Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants