Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HEAD and GET in static document serving #38

Closed
colinligertwood opened this issue Oct 29, 2012 · 2 comments
Closed

HEAD and GET in static document serving #38

colinligertwood opened this issue Oct 29, 2012 · 2 comments

Comments

@colinligertwood
Copy link
Contributor

In HTTP/HTTPS standalone server mode, It looks like issuing a HEAD to a document under static root returns the full document, and omits Content-type. Issuing a GET to a static doc also omits Content-type.

This causes problems with IE as it rejects stylesheets not served with text/css as the mime-type unless in quirks/compatibility mode. In my situation, I need standards mode so canvas will work.

A normal request (non-static)

Escape character is '^]'.
HEAD / HTTP/1.0

HTTP/1.0 302 FOUND
Vary: Cookie
Content-Type: text/html; charset=utf-8
Location: http://dev.shieldcore.com/logout/

A static HEAD request

Escape character is '^]'.
HEAD /static/css/style.css HTTP/1.0

HTTP/1.0 200 OK
Content-Length: 19123
Last-Modified: Sat, 27 Oct 2012 02:02:45 GMT

/* Color Schemes */

.H2O1804 a { color: #FF9A00; }

A static GET request

GET /static/css/style.css HTTP/1.0

[pid: 26280|app: 0|req: 23/44] 192.168.56.101 () {20 vars in 248 bytes} [Fri Oct 26 19:27:39 2012] GET /static/css/style.css => generated 19123 bytes in 0 msecs via sendfile() (HTTP/1.0 200) 2 headers in 88 bytes (0 switches on core 0)
HTTP/1.0 200 OK
Content-Length: 19123
Last-Modified: Sat, 27 Oct 2012 02:02:45 GMT

/* Color Schemes */

.H2O1804 a { color: #FF9A00; }

The log entry:

[pid: 26280|app: 0|req: 17/37] 192.168.56.101 () {20 vars in 249 bytes} [Fri Oct 26 19:22:35 2012] HEAD /static/css/style.css => generated 19123 bytes in 0 msecs via sendfile() (HTTP/1.0 200) 2 headers in 88 bytes (0 switches on core 0)
@colinligertwood
Copy link
Contributor Author

My bad... I had a corrupt mime.types file. Fixed that and the Content-type: is now set correctly. Still sending full content on head tho. Not terribly critical.

@unbit
Copy link
Owner

unbit commented Oct 30, 2012

HEAD support has been added to master, Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants