-
Notifications
You must be signed in to change notification settings - Fork 65
support less-commonly-used HTTP verbs: PUT, PATCH, DELETE #79
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
base: develop
Are you sure you want to change the base?
Conversation
since it seems they're used by Ruby-on-Rails apps
| Response::builder() | ||
| .status(StatusCode::NO_CONTENT) | ||
| .header(header::ALLOW, "GET, POST, HEAD, OPTIONS") | ||
| .header( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate Code - Priority: High
This block of code is duplicated in ferron/src/request_handler.rs starting at line 805.
| _ => { | ||
| let mut header_map = HeaderMap::new(); | ||
| if let Ok(header_value) = HeaderValue::from_str("GET, POST, HEAD, OPTIONS") { | ||
| if let Ok(header_value) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate Code - Priority: High
This block of code is duplicated in ferron/src/request_handler.rs starting at line 813.
PR SummaryChanges Overview
Identified Issues
Recommendations
|
|
I was thinking about security scanners... |
|
Yeah, depending on what host is receiving the verbs, that could indeeed be a security concern. So maybe less-common verb support needs to be configured per-host? |
|
Yes, I think that's a good idea to introduce a configuration option for allowing "PUT", "PATCH", and "DELETE" HTTP methods. |
Looks like Ruby-on-Rails apps heavily use less-commonly-used HTTP verbs, so this patch adds support for them.
I'm not entirely sure if this is the right way to patch in support for new HTTP verbs in general, but it did work on my server. Let me know what you think. In my case, I only need the extra verbs for a reverse proxied host, and I think this patch is more general than that?