PowerShell / Polaris

A cross-platform, minimalist web framework for PowerShell
https://powershell.github.io/Polaris/
MIT License
512 stars 115 forks source link

204 - No content #171

Closed bgelens closed 5 years ago

bgelens commented 5 years ago

Polaris Feature Request

Is your feature request related to a problem? Please describe

When 204 StatusCode is needed, this is not a problem. However, there is always a content-length of 1 and when checking with fiddler, I can see a symbol (0 byte?) being returned.

I need a way to have actually nothing returned but headers. This doesn't seem possible now.

$Response.StatusCode = 204

This should result in

HTTP/1.1 204 No Content
Server: Microsoft-HTTPAPI/2.0
Date: Thu, 20 Dec 2018 15:33:21 GMT

But instead results in: image

As you can see, there is actually content returned which I did not set. Also the content type is incorrect (although I can null it). Don't mind the protocolversion header, I put that in myself.

Would be nice if we could just send nothing with only headers!

TylerLeonhardt commented 5 years ago

Hmmm I wonder if this is because we still send empty string back to the client.

TylerLeonhardt commented 5 years ago

Thanks for filing the issue!