Skip to content

Commit

Permalink
Merge pull request #104 from Chaphasilor/improve-theeye-fix
Browse files Browse the repository at this point in the history
Only apply the Content-Length fix to The Eye ODs
  • Loading branch information
KoalaBear84 authored Aug 22, 2021
2 parents 5817123 + af77fdc commit 7893d17
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/OpenDirectoryDownloader/Helpers/UrlHeaderInfoHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ public static class UrlHeaderInfoHelper

try
{
if (httpResponseMessage.Content?.Headers.ContentLength == null) {
if (
(new Uri(url)).Host == "the-eye.eu" && // workaround until we come up with a better way to fix this **without slowing down scans of ODs that don't report `Content-Length` at all for some files** (e.g. .php, .html)
httpResponseMessage.Content?.Headers.ContentLength == null
) {
throw new Exception("Missing Content-Length header!");
}
return httpResponseMessage.Content?.Headers.ContentLength;
Expand Down

0 comments on commit 7893d17

Please sign in to comment.