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

Make versioner consider the mount destination path #1570

Merged
merged 1 commit into from
Feb 5, 2017
Merged

Conversation

namusyaka
Copy link
Contributor

Fixes #636

If my perception is correct, it is enough that only this changes is enough.
@dblock Thoughts?

@coveralls
Copy link

coveralls commented Feb 1, 2017

Coverage Status

Coverage increased (+0.002%) to 99.106% when pulling 0539af3 on fix-636 into d124df7 on master.

@coveralls
Copy link

coveralls commented Feb 1, 2017

Coverage Status

Coverage increased (+0.002%) to 99.106% when pulling 0539af3 on fix-636 into d124df7 on master.

@@ -295,7 +295,8 @@ def build_stack(helpers)
stack.use Grape::Middleware::Versioner.using(namespace_inheritable(:version_options)[:using]),
versions: namespace_inheritable(:version) ? namespace_inheritable(:version).flatten : nil,
version_options: namespace_inheritable(:version_options),
prefix: namespace_inheritable(:root_prefix)
prefix: namespace_inheritable(:root_prefix),
mount_path: namespace_stackable(:mount_path)[0]
Copy link
Member

Choose a reason for hiding this comment

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

Maybe .first?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@@ -25,6 +25,7 @@ def default_options

def before
path = env[Grape::Http::Headers::PATH_INFO].dup
path.sub!(mount_path, '') if mount_path && path.start_with?(mount_path)
Copy link
Member

Choose a reason for hiding this comment

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

This seems dangerous, like foo vs. foobar, one starts with another.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I have just force-pushed changes

@namusyaka
Copy link
Contributor Author

@dblock Could you confirmed current changes?

@coveralls
Copy link

coveralls commented Feb 4, 2017

Coverage Status

Coverage increased (+0.002%) to 99.106% when pulling 393d362 on fix-636 into d124df7 on master.

9 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 99.106% when pulling 393d362 on fix-636 into d124df7 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 99.106% when pulling 393d362 on fix-636 into d124df7 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 99.106% when pulling 393d362 on fix-636 into d124df7 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 99.106% when pulling 393d362 on fix-636 into d124df7 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 99.106% when pulling 393d362 on fix-636 into d124df7 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 99.106% when pulling 393d362 on fix-636 into d124df7 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 99.106% when pulling 393d362 on fix-636 into d124df7 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 99.106% when pulling 393d362 on fix-636 into d124df7 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 99.106% when pulling 393d362 on fix-636 into d124df7 on master.

@dblock
Copy link
Member

dblock commented Feb 5, 2017

Looks good.

@dblock dblock merged commit 3b46b47 into master Feb 5, 2017
@namusyaka namusyaka deleted the fix-636 branch February 5, 2017 10:06
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