stdbrouw/Extendables — Issue #16: HTTP get, Body isnt read correct in BINARY Mode
Author: grefel
Created: 2011-11-07 18:00:19+00:00
State: open

I tried to download a ZIP File from a server. It looks like some header
information is written in the body in BINARY Mode.
The Resulting ZIP File starts with:

HTTP/1.1 200 OK
Date: Mon, 07 Nov 2011 17:10:19 GMT
Server: Apache
Last-Modified: Mon, 07 Nov 2011 17:10:01 GMT
ETag: "172885c-490-4b12820074c40"
Accept-Ranges: bytes
Content-Length: 1168
Connection: close
Content-Type: application/zip
-------------> ZIP Content.

Problem is in Line 500 of core-packages\http\lib\index.jsx

`var start_of_body = this.raw.indexAfter('\n\n');`

I hacked the following solution:

`// Fix Linebreaks ...
this.raw = this.raw.replace(/(\r\n\r\n|\r\r)/, '\n\n');
var start_of_body = this.raw.indexAfter('\n\n');`

I guess there is a more elegant solution out there? But I havent found a
quick fix for the line-end-problem.