Opened 11 years ago

Closed 11 years ago

#4549 closed (fixed)

Set mime type on admin media content (images, css) under WSGI

Reported by: Stefane Fermgier <sf@…> Owned by: Adrian Holovaty
Component: contrib.admin Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Content-type is not set for admin media content.

Macintosh% wget -S http://localhost:8080/media/css/dashboard.css
--22:17:36--  http://localhost:8080/media/css/dashboard.css
           => `dashboard.css.2'
Resolving localhost..., ::1
Connecting to localhost||:8080... connected.
HTTP request sent, awaiting response... 
  HTTP/1.0 200 OK
  Date: Tue Jun 12 20:17:36 2007
  Server: WSGIServer/0.1 Python/2.4.3
  Content-Length: 321
Length: 321 [text/css]

Apparently, this isn't an issue in most users circumstances, but It doesn't work for me as I like to put my apps behind an Apache proxy (using the ProxyPass / ProxyPassReverse directives):

Macintosh% wget -S http://localhost/media/css/dashboard.css
--22:26:51--  http://localhost/media/css/dashboard.css
           => `dashboard.css.3'
Resolving localhost... 
Connecting to localhost|...|:80... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Date: Tue, 12 Jun 2007 20:23:47 GMT
  Server: WSGIServer/0.1 Python/2.4.1
  Content-Length: 321
  X-Cache: MISS from localhost
  Keep-Alive: timeout=15, max=100
  Connection: Keep-Alive
  Content-Type: text/plain; charset=iso-8859-1
Length: 321 [text/plain]

The attached patch should fix the issue.

Attachments (1)

django-admin-mimetype.patch (862 bytes) - added by Stefane Fermgier <sf@…> 11 years ago.
Patch fixing the issue

Download all attachments as: .zip

Change History (3)

Changed 11 years ago by Stefane Fermgier <sf@…>

Attachment: django-admin-mimetype.patch added

Patch fixing the issue

comment:1 Changed 11 years ago by Simon G. <dev@…>

Summary: No mime type on admin media content (images, css)Set mime type on admin media content (images, css) under WSGI
Triage Stage: UnreviewedReady for checkin

comment:2 Changed 11 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [5502]) Fixed #4549 -- WSGI server now sets mime type correctly for admin media content. Thanks, Stefane Fermgier

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