Closed Bug 747494 Opened 13 years ago Closed 13 years ago

Consider HTTP 415 on invalid media type

Categories

(Cloud Services Graveyard :: Server: Sync, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gps, Assigned: rfkelly)

Details

(Whiteboard: [qa?])

Attachments

(2 files)

Currently when the client issues a request with an improper media type via Content-Type (e.g. POST storage/collection/foo with Content-Type: application/octet-stream -- as tested in test_set_collection_input_formats), the server responds with a 400. HTTP has a dedicated status code for this: 415 Unsupported Media Type. I propose changing the spec and server implementation to send this instead of a 400.
So it does, I'll make the change.
Assignee: nobody → rkelly
Whiteboard: [qa?]
Attachment #617365 - Flags: review?(gps)
This adds 415-Unsupported-Media-Type to both POST /storage/collection and PUT /storage/collection/id. The latter previously had no explicit checking of the content-type header.
Attachment #617366 - Flags: review?(telliott)
Comment on attachment 617365 [details] [diff] [review] docs pach adding 415 response code Review of attachment 617365 [details] [diff] [review]: ----------------------------------------------------------------- Looks good! ::: source/spelling_wordlist.txt @@ +72,4 @@ > json > keyexchange > KeyExchange > +kibibypes "bypes" ?
Attachment #617365 - Flags: review?(gps) → review+
Comment on attachment 617366 [details] [diff] [review] code pach adding 415 response code This is fine, but I think it should get rolled into cornice eventually. You specify acceptable media types somewhere and it magically gives you this.
Attachment #617366 - Flags: review?(telliott) → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Product: Cloud Services → Cloud Services Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: