forked from soveran/cuba
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make default_headers plugin correctly handle mixed/upper case content…
…-type header on Rack 3 (Fixes #373) Previously, the DEFAULT_HEADERS constant was a plain hash even on Rack 3, so it didn't handle the folding to lower case. When using the default_headers plugin, the given headers were merged into DEFAULT_HEADERS, so a change in case resulted in duplicate keys in the resulting hash. Because default headers do not overwrite existing headers, the first default header (the lowercase content-type Roda uses by default) would be kept, instead of the default header set by the plugin (the mixed case Content-Type). With this change, the DEFAULT_HEADERS constant is a Rack::Headers instance, so the mixed/upper case Content-Type will be converted to lowercase and overwrite the lowercase default, before it is set in app.opts[:default_headers].
- Loading branch information
1 parent
eb7843c
commit 8757ac7
Showing
3 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters