Opened 18 years ago

Closed 18 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: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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... 127.0.0.1, ::1
Connecting to localhost|127.0.0.1|: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@…> 18 years ago.
Patch fixing the issue

Download all attachments as: .zip

Change History (3)

by Stefane Fermgier <sf@…>, 18 years ago

Attachment: django-admin-mimetype.patch added

Patch fixing the issue

comment:1 by Simon G. <dev@…>, 18 years ago

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 by Adrian Holovaty, 18 years ago

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