Code

Opened 7 years ago

Closed 7 years ago

#4549 closed (fixed)

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

Reported by: Stefane Fermgier <sf@…> Owned by: adrian
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:

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@…> 7 years ago.
Patch fixing the issue

Download all attachments as: .zip

Change History (3)

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

Patch fixing the issue

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from No mime type on admin media content (images, css) to Set mime type on admin media content (images, css) under WSGI
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 7 years ago by adrian

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

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

Add Comment

Modify Ticket

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


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

 
Note: See TracTickets for help on using tickets.