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

Strip Content-Type options for request #75

Merged
merged 4 commits into from Apr 28, 2015
Merged

Strip Content-Type options for request #75

merged 4 commits into from Apr 28, 2015

Conversation

dlwr
Copy link

@dlwr dlwr commented Apr 27, 2015

(refs. #70)

Hi, some http clients always set Content-Type options for request, such as "application/json; charset=UTF-8".
This PR strip Content-Type options like PR#70 above.

BR,
dlwr

if request.media_type && !empty_request?(request)
unless Rack::Mime.match?(request.media_type, @link.enc_type)
if request_media_type(request) && !empty_request?(request)
unless Rack::Mime.match?(request.media_type.to_s, @link.enc_type)
Copy link
Member

Choose a reason for hiding this comment

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

In the other pull we match against the split version of the media type, instead of the original. I think it would be good to do the same here. What do you think?

Copy link
Author

Choose a reason for hiding this comment

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

sorry, it's very embarassing. I forgot to fix this line.

geemus added a commit that referenced this pull request Apr 28, 2015
Strip Content-Type options for request
@geemus geemus merged commit 0a4bc75 into interagent:master Apr 28, 2015
@geemus
Copy link
Member

geemus commented Apr 28, 2015

Thanks!

@dlwr dlwr deleted the fix_request_media_type_check branch April 30, 2015 01:15
momosetkn pushed a commit to momosetkn/committee that referenced this pull request Apr 8, 2023
matching in this context has the format of
```
['/user/{id}/edit', { 'id' => 1 }]
```
As the idea is to find matching path by minimum path params, the code should find min by the size of second element
momosetkn pushed a commit to momosetkn/committee that referenced this pull request Apr 8, 2023
Find path by extracted params than path length, Close interagent#75
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.

None yet

2 participants