Page MenuHomePhabricator

webserver treats script headers flaky
Closed, DeclinedPublic

Description

Webservers are extremely flaky with regards to headers. While migrating from the toolserver I have noticed that the webservers on labs are quirky.

In some scripts I must define the header:
Content-Type: text/html\n\n
In other cases that same text is output as visible markup, and if there is any extra spaces in the headers (by accident or whatever) the webserver will not output the content.

On the toolserver I never had to worry about that as the servers just worked. Now I am running into a lot of inconsistencies who's error messages give zero clues about the cause.


Version: unspecified
Severity: normal

Details

Reference
bz54053

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:10 AM
bzimport added a project: Toolforge.
bzimport set Reference to bz54053.

Could you provide some examples, especially where Zeus gave a different output than Apache?

In general, "Content-Type:" (or other headers) appearing as visible mark-up means that the script sent non-header data to the webserver before the header. That's not something that any webserver can fix.

Ive since modified all my code to deal with this, but I have a function for building the top of an HTML file (title, scripts, ect) and in some cases the content type is required and in others it is displayed as raw text.

example where content type is displayed: http://tools.wmflabs.org/betacommand-dev/nfcc/NFCC9.html

and an example of where its required and not displayed: http://tools.wmflabs.org/betacommand-dev/cgi-bin/img_removal.py?title=London_City_%28soccer_club%29

Both examples look fine to me?!