Skip to content

Commit cc15b81

Browse files
committed
extended localhost list
1 parent f5e1fb5 commit cc15b81

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Tetrifact.Web/Controllers/ArchivesController.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,15 @@ public ActionResult GetArchive(string packageId, [FromQuery(Name = "ticket")] st
9494
if (!_indexReader.PackageExists(packageId))
9595
throw new PackageNotFoundException(packageId);
9696

97+
string[] localhosts = new string[] {
98+
"localhost",
99+
"127.0.0.1",
100+
"0.0.0.0"
101+
};
102+
97103
// enforce ticket if queue enabled
98104
RequestHeaders headers = Request.GetTypedHeaders();
99-
bool isLocal = headers.Host.Host.ToLower() == "localhost";
105+
bool isLocal = localhosts.Contains(headers.Host.Host.ToLower());
100106

101107
// local (this website) downloads always allowed.
102108
if (!isLocal && _settings.MaximumSimultaneousDownloads.HasValue)

0 commit comments

Comments
 (0)