Skip to content

Commit a5e8556

Browse files
fix: Server101 Content Type Fix ( Fixes #10 )
1 parent c30e50d commit a5e8556

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Servers/Server101.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Start-ThreadJob -ScriptBlock {param([Collections.IDictionary]$io)
7070
$reply.Length=$file.Length; $reply.Close(); continue nextRequest
7171
}
7272
filter outputFile {
73-
$reply.ContentType = $contentTypes[$potentialPath]
73+
$reply.ContentType = $contentTypes[$localPath]
7474
$fileStream = $file.OpenRead()
7575
$fileStream.CopyTo($reply.OutputStream)
7676
$fileStream.Close(); $fileStream.Dispose(); $reply.Close()
@@ -88,7 +88,7 @@ Start-ThreadJob -ScriptBlock {param([Collections.IDictionary]$io)
8888
if ($method -notin 'get', 'head') { outputError 405 }
8989
# If the file does not exist, output error 404
9090
if (-not ($files -and $files[$localPath])) { outputError 404 }
91-
$file = $files[$request.Url.LocalPath]
91+
$file = $files[$localPath]
9292
# If they asked for header information, output it.
9393
if ($request.httpMethod -eq 'head') { outputHeader }
9494
outputFile # otherwise, output the file.

0 commit comments

Comments
 (0)