Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#7495 closed (wontfix)

XViewMiddleware gets Content-Type wrong

Reported by: jdunck 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 jdunck 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by jdunck

comment:1 Changed 6 years ago by ericholscher

  • milestone set to 1.0
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 6 years ago by ubernostrum

  • Component changed from Documentation to HTTP 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 6 years ago by jacob

  • Resolution set to wontfix
  • Status changed from new to closed

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 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.