You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Powershell scripts are served up as application/octet-stream. Is there a way to serve these up as text? (I've already tried adding a MIME type in IIS.)
You can add a value HKEY_CLASSES_ROOT\.ps1\ContentType set to something like text/x-powershell-source on your server, or you can modify that mime-types.txt file.
I'm going to keep this bug open until we have an entry in mime-types.txt for powershell.
The point is that it is an insurmountable challenge to build an exhaustive list. We should default to the git method of detecting a binary vs text file. Specifically, we should check the first chunk (1kb?) of the file for any null bytes. This is slightly problematic when dealing with multibyte encodings.
Activity
otac0n commentedon May 15, 2013
The current implementation first checks a file, called "mime-types.txt", located in the sharedlib project.
If it fails to find the file extension in that file, it searches the windows registry for the mime type.
See:
https://github.com/otac0n/WebGitNet/blob/master/WebGitNet.SharedLib/MimeUtilities.cs
You can add a value
HKEY_CLASSES_ROOT\.ps1\ContentTypeset to something liketext/x-powershell-sourceon your server, or you can modify that mime-types.txt file.I'm going to keep this bug open until we have an entry in mime-types.txt for powershell.
seankearon commentedon May 16, 2013
That does the job - many thanks!
otac0n commentedon May 26, 2013
There are several examples of this issue:
The point is that it is an insurmountable challenge to build an exhaustive list. We should default to the git method of detecting a binary vs text file. Specifically, we should check the first chunk (1kb?) of the file for any null bytes. This is slightly problematic when dealing with multibyte encodings.