0
Planned

Multiple distinct Content-Length headers received. This is disallowed to protect against HTTP response splitting attacks.

Justin Brown 9 years ago updated by Tom 9 years ago 18
Not sure why, but one book will not let me download it from the server. I can read it on the web just fine. But when I try to download it it gives the error: Multiple distinct Content-Length headers received. This is disallowed to protect against HTTP response splitting attacks.


I've done some research to try and fix this but I've come up empty. Every one seems to believe that it's caused by a comma in the file name, but this is not the case. There isn't a single comma in the entire cbz archive. I'm running Ubuntu Server 14.04.
The main error that I posted about is from google chrome. firefox also throws and error but it says:

Corrupted Content Error
The page you are trying to view cannot be shown because an error in the data transmission was detected.The page you are trying to view cannot be shown because an error in the data transmission was detected.Please contact the website owners to inform them of this problem.

I just attempted to use the new microsoft edge browser on one of my win 10 machines and it gave no error and downloaded perfectly. No issues. I'd try internet explorer, but I have that garbage disabled.
+1
Under review
Interesting, I have not encountered this error yet.

If this happens only for a specific file, could you put it somewhere I could download it ? (you can email me a link at: tom 'at' vaemendis 'dot' net)
If not, the name of the file would help. Also, do your server run with a non-english locale ? And do you access it directly or through a proxy ?

(I do not support Internet Explorer anyway, would be a waste of time given the lack of respect it has for standards)
I'll email you shortly. Thanks for the response. :)
Emails have been sent.
I have since discovered one other file that I have the same issue with as well. The only similarities that these two files share is their filesize. They both just so happen to be over 2GB. All the other books below 2GB work just fine. These two are the biggest books I have. I assume that would be the issue but I wouldn't have the slightest idea how to go about solving it.

Safari seems to work perfectly fine too. It's just Chrome & Firefox that seem to hate them.
From what research I could do, there appears to be a likely culprit, why it would only effect certain files is beyond me. But I figured it was worth nothing here. I first came across this old post, https://code.google.com/p/chromium/issues/detail?id=100011 and that led me to this response which could indicate a possible fix http://kb.mozillazine.org/Filenames_with_spaces_are_truncated_upon_download
Thanks for all this info, it'll help a lot.
I'll investigate further asap (can't work on it this week).
I found the bug ! Ubooquity does indeed send two "Content-Length" headers. Which are always identical, except for files bigger than 2 GB. That's when some browsers (rightfully) complain.

Unfortunately the bug is not that easy to fix (lots of potential side effects). So I'll put in on my todo list but don't expect it to be fixed soon.

Excellent. At the very least, we figured it out. Honestly though, if the new version of the reader will allow fitting to height, I won't have any need to download them. :)

Any update on this? my reverse proxy is downright refusing to pass on anything with dual Content-Length headers, which for me is every single file in Ubooquity.

I plan to try to replace the current HTTP server I use (NanoHTTPD) with Jetty. This would solve the header problem, among others.

Ah, that would be great! any ETA on that?

Probably before summer.

So 1.10.1 is out, and this isn't fixed yet... What is the status?

Not fixed yet.

The fix will be announced in the release notes when it's done.