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

content-type of static file header #353

Closed
yitao opened this issue Jan 1, 2016 · 4 comments
Closed

content-type of static file header #353

yitao opened this issue Jan 1, 2016 · 4 comments

Comments

@yitao
Copy link

yitao commented Jan 1, 2016

My env is window7 x64 &python2.7
I only want to build my webapp with web.py . but i don't want use apache or nginx .
Then the content-type is "application/x-css" in response header when i request a css file .
It worked on ie8 but not on chrome-45 and firefox-43 .
So i change this code of httpserver.py in the 216 line(class StaticApp, func send_header , the 1 line):
--code like this--
self.headers.append((name, value)) ---> self.headers.append((name, "application/octet-stream"))
-- end --
So, Anybody can tell me why it worked.? Does it mean we can set the content-type also is "application/octet-stream"? and let the browser does other thing like parse file content-type ?
thanks

@yitao
Copy link
Author

yitao commented Jan 1, 2016

myfalut,
--code like this--
self.headers.append((name, value)) --->
if name == "content-type":
self.headers.append((name, "application/octet-stream" if value=="application/x-css" else value))
else:
self.headers.append((name, value))
-- end --

@denglj
Copy link

denglj commented Jan 21, 2016

“text/css”

@yitao
Copy link
Author

yitao commented Jan 21, 2016

"application/x-css " to "text/css"?
i only want to know original design

@iredmail
Copy link
Contributor

iredmail commented Jun 9, 2019

Closed: �seems not a webpy issue and no further update from reporter.

@iredmail iredmail closed this as completed Jun 9, 2019
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

3 participants