Django

Code

Ticket #4549 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

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

Reported by: Stefane Fermgier <sf@fermigier.com> Assigned to: adrian
Milestone: Component: django.contrib.admin
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

django-admin-mimetype.patch (0.8 kB) - added by Stefane Fermgier <sf@fermigier.com> on 06/12/07 15:30:13.
Patch fixing the issue

Change History

06/12/07 15:30:13 changed by Stefane Fermgier <sf@fermigier.com>

  • attachment django-admin-mimetype.patch added.

Patch fixing the issue

06/15/07 04:38:25 changed by Simon G. <dev@simon.net.nz>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Ready for checkin.
  • summary changed from No mime type on admin media content (images, css) to Set mime type on admin media content (images, css) under WSGI.
  • needs_tests changed.
  • needs_docs changed.

06/20/07 01:16:57 changed by adrian

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

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


Add/Change #4549 (Set mime type on admin media content (images, css) under WSGI)




Change Properties
Action