Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#7495 closed (wontfix)

XViewMiddleware gets Content-Type wrong

Reported by: Jeremy Dunck Owned by: nobody
Component: HTTP handling Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: UI/UX:


The doc.XViewMiddleware gives short-circuits views to supply the X-View header.

It doesn't actually call the view, and uses the default Content-Type of HttpRequest.

This means that HEAD requests for people logged in as staff function incorrectly; in our case, this was a staffer's HEAD request for an RSS feed getting text/html.

I understand the performance implications of calling the view despite its content not being returned, but I think it's the right thing to do.

Attachments (1)

doc-content_type.diff (749 bytes) - added by Jeremy Dunck 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Jeremy Dunck

Attachment: doc-content_type.diff added

comment:1 Changed 10 years ago by Eric Holscher

milestone: 1.0
Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 10 years ago by James Bennett

Component: DocumentationHTTP handling

Recategorizing since this is actually a bug in how we're doing HTTP for the middleware, not a bug in Django's documentation.

comment:3 Changed 10 years ago by Jacob

Resolution: wontfix
Status: newclosed

The X-view middleware is a hack, and a kinda nasty one at that. I'd like to keep it that way, though, so this is something for a custom/extended x-view middleware.

comment:4 Changed 7 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top