Skip to content

Commit

Permalink
Fix casing of Content-Type header
Browse files Browse the repository at this point in the history
It turns out, despite the HTTP spec declaring that header field names
should be case-insensitive, some clients treat them wrongly, and
consider "Content-type" to not match "Content-Type".

CyberDuck was one of those clients, now fixed upstream in
https://trac.cyberduck.io/ticket/8999

To reduce future occurances of this bug, fix the casing of the
Content-Type header, to strictly comply with the HTTP specification (be
strict about what you send, and generous about what you receive).

Fixes: #12939
Backport: infernalis, hammer, firefly
Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
(cherry picked from commit 1b9fbff)
  • Loading branch information
Robin H. Johnson authored and kmroz committed Oct 27, 2015
1 parent 9764da5 commit db1cbe7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rgw/rgw_rest.cc
Expand Up @@ -555,7 +555,7 @@ void end_header(struct req_state *s, RGWOp *op, const char *content_type, const

int r;
if (content_type) {
r = s->cio->print("Content-type: %s\r\n", content_type);
r = s->cio->print("Content-Type: %s\r\n", content_type);
if (r < 0) {
ldout(s->cct, 0) << "ERROR: s->cio->print() returned err=" << r << dendl;
}
Expand Down

0 comments on commit db1cbe7

Please sign in to comment.