Write newlines before HTTP header -


recently trying upload large files (hundreds of megabytes) through browser on http. may take long time request complete, browser (chrome 43) seemed disconnecting after 5 minutes of not receiving response server. learned , confirmed if streamed newlines in http response, browser wouldn't disconnect, , upload succeeded after 10 minutes.

i want use trick prevent disconnects, think means have set http response , headers before streaming newlines. i'd still able set 201, 202, 400, 500 etc status codes if goes wrong in request.

i thinking might prepend http header newlines, , send headers, , response. allowed / browsers support that? if not, there better way prevent disconnects?

it appear disallowed the specification:

6.1 status-line

the first line of response message status-line, consisting of protocol version followed numeric status code , associated textual phrase, each element separated sp characters. no cr or lf allowed except in final crlf sequence.

  status-line = http-version sp status-code sp reason-phrase crlf 

though i'm still curious if browsers ignore , trim leading whitespace anyway.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -