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

revert ignore params in path commit #32

Merged
merged 1 commit into from
Feb 2, 2018
Merged

Conversation

jadercorrea
Copy link
Contributor

The commit ignore params in path removed URI query params from authorization calculation. This behavior is not compatible with
mgomes api_auth.

This PR restores this with a small refactoring.

removed URI query params from authorization calculation. This behavior is not compatible with
mgomes api_auth. This PR restores this with a small refactoring.
Copy link
Contributor

@zfletch zfletch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. I have one suggested refactor, then I'll merge it and put out a new version.


case query do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this case statement can be replaced with "#{value_for(path)}#{query}".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could have "#{value_for(path)}?#{query}" (note the ?); however that would append the ? to paths that don't have query params. I believe you will have to conditionally determine if there is a query string to know whether or not to include it, as done here with the case statement.

Let me know if you were thinking of something different, or if there's another control structure you'd like to use to conditionally add the ?.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like I missed the ? in "#{path}?#{query}". I think the code here makes sense then.

@zfletch zfletch merged commit 3509eb7 into TheGnarCo:master Feb 2, 2018
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.

3 participants