Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Content-Type should only be set once when handling admin server requests
Summary: Instead of setting multiple Content-Types, change the Content-Type to what is being returned. This caused problems when fronting the admin server with Apache. For some commands it was fine (eg check-load) but for commands that returned html, xml or json Apache would return a 500 error and complain about ``` FastCGI: comm with server "/hhvm-admin" aborted: error parsing headers: duplicate header 'Content-Type' ``` After using the fcgi CLI protocol to see what hhvm was sending back I noticed that HHVM would sometimes send back two content types: always text/plain followed by the actual content type, say application/json. After poking through the code I noticed that it seems to do just that: when an admin server request received it would set the Content-Type to text/plain and if the command returned some other content type it would set *another* Content-Type header to the real Content-Type. This patch changes that behavior to change the existing text/plain header to the real Content-Type instead o Closes facebook#3941 Reviewed By: @paulbiss Differential Revision: D1606946
- Loading branch information