Ticket #3545 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

Content-Type header case sensitive

Reported by: johnleach Assigned to: markjaquith
Priority: normal Milestone: 2.3
Component: General Version: 2.0.6
Severity: normal Keywords: headers mime type http wp-cache has-patch
Cc: john@johnleach.co.uk

Description

Wordpress 2.0.6 (and below) use of the Content-Type header is inconsistent. In most places it sends "Content-Type" but in some, particularly the RSS templates, it sends "Content-type" (note the lowercase 't')

RFC2616 implies that this header is case sensitive.

I came across this whilst using the WP-Cache plugin. It is strict about the header case and ignores the RSS feed content types, overriding it with it's own default of html/text. So WP-Cached RSS feeds end up with the wrong content-type, breaking some feed readers.

Attachments

3545-Content-Type.diff (7.6 kB) - added by foolswisdom on 01/10/07 20:36:38.
Left the cases in projects that WP includes
3545.diff (8.1 kB) - added by Nazgul on 04/01/07 01:03:11.

Change History

01/09/07 13:23:00 changed by johnleach

  • cc set to john@johnleach.co.uk.

01/10/07 14:16:46 changed by markjaquith

  • owner changed from anonymous to markjaquith.
  • status changed from new to assigned.
  • milestone changed from 2.0.7 to 2.2.

RFC2616 explicitly says that HTTP headers are case-insensitive. That said, it doesn't hurt us to capitalize them as they are presented in the RFC. Well-behaved clients won't care and lazy clients will more likely than not use the capitalization that the RFC uses.

The only problem I see is that some of the instances in WP of "Content-type" are in external libraries like Snoopy or TinyMCE. Changing those may present an added burden for maintenance.

At any rate, 2.2 territory.

01/10/07 15:32:28 changed by johnleach

Doh, I see now that I was looking at only one section of the RFC (duh). It does state that they are case-insensitive so this is definitely a bug in WP-Cache (which I've reported). Thanks Mark.

01/10/07 20:36:38 changed by foolswisdom

  • attachment 3545-Content-Type.diff added.

Left the cases in projects that WP includes

01/10/07 20:39:46 changed by foolswisdom

  • keywords changed from headers mime type http wp-cache to headers mime type http wp-cache has-patch.

03/07/07 06:00:47 changed by markjaquith

  • keywords changed from headers mime type http wp-cache has-patch to headers mime type http wp-cache needs-patch.

Doesn't apply cleanly. Feed files moved.

03/27/07 23:16:09 changed by foolswisdom

  • milestone changed from 2.2 to 2.4.

04/01/07 01:03:11 changed by Nazgul

  • attachment 3545.diff added.

04/01/07 01:04:20 changed by Nazgul

  • keywords changed from headers mime type http wp-cache needs-patch to headers mime type http wp-cache has-patch.
  • milestone changed from 2.4 to 2.3.

Patch refreshed

06/02/07 05:21:19 changed by rob1n

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [5640]) Content-Type, not Content-type, as headers are case sensitive. Props foolswisdom and Nazgul. fixes #3545