Cyberduck Mountain Duck CLI

#8999 closed defect (fixed)

Sends multiple content-type headers

Reported by: robbat2 Owned by: dkocher
Priority: high Milestone: 4.7.3
Component: s3 Version: 4.7.2
Severity: normal Keywords: content-type, s3, headers, ceph
Cc: Architecture:


Ceph RadosGW, as used in DreamHost's DreamObjects, sends back the Content-Type header as "Content-type", with the "t" on "type" in lowercase.

If you try to edit the metadata on an object, and leave that header with lowercase "type" as is for editing, AND on submission of changes Cyberduck sends an ADDITIONAL "Content-Type" header with the initial capitalization, and trips up in the JetS3 library.

JetS3 throws this error: HTTP header name occurs multiple times in request with different values, probably due to mismatched capitalization when setting metadata names. Duplicate metadata name: 'Content-Type', All metadata: {Content-type=image/jpeg, x-amz-metadata-directive=REPLACE, Cache-Control=public,max-age=2592000, x-amz-copy-source=/CENSORED/CENSORED/CENSORED.jpg, x-amz-storage-class=STANDARD, Content-Type=application/octet-stream}

The HTTP specification declares a few things that need to be considered for this:

  1. Field names are case-insensitive.
  1. Multiple instances of a field with the same name should be treated as if concatenated with a comma, but are ONLY valid if the field takes a list.

  1. The Content-Type field must have a value of "type/subtype*(parameter)"

Therefore, some changes are required:

  1. The edit interface for metadata/headers must prohibit the addition of multiple headers that are the same when considered without case.
  2. The client should NOT silently add the extra Content-Type header.

Trying to send multiple content-type capitalizations to AmazonS3 causes S3 to claim there is a signature mismatch. (As an aside, I'm fixing the Ceph RADOSGW to have the common capitalization of Content-Type, but CyberDuck should be fixed as well).

Change History (4)

comment:1 Changed on Sep 3, 2015 at 8:13:59 AM by dkocher

  • Milestone set to 4.8
  • Status changed from new to assigned
  • Summary changed from Cyberduck sends multiple content-type headers to Sends multiple content-type headers
  • Version set to 4.7.2

comment:2 Changed on Sep 3, 2015 at 8:50:25 AM by dkocher

Add failing test in r18092.

comment:4 Changed on Sep 3, 2015 at 11:43:37 AM by dkocher

  • Resolution set to fixed
  • Status changed from assigned to closed

In r18093.

Note: See TracTickets for help on using tickets.