500 Error from the server responds with a collection of all errors instead of just the latest
Closed this issue · 0 comments
Tiberriver256 commented
Polaris Bug Report
500 Errors from the server respond with a collection of all errors instead of just the latest error.
Steps to reproduce
New-PolarisGetRoute -Path '/error' -ScriptBlock { throw 'Error }
GET http://localhost:8080/error HTTP/1.1
User-Agent: Fiddler
Host: localhost:8080
HTTP/1.1 500 Internal Server Error
Content-Length: 8071
Content-Type: text/plain
Server: Microsoft-HTTPAPI/2.0
Date: Sat, 08 Dec 2018 01:36:07 GMT
System.Management.Automation.RuntimeException: ErrorAt line:2 char:2
+ throw 'Error'
+ ~~~~~~~~~~~~~
------------------------------------------------------------------
GET http://localhost:8080/error HTTP/1.1
User-Agent: Fiddler
Host: localhost:8080
HTTP/1.1 500 Internal Server Error
Content-Length: 8177
Content-Type: text/plain
Server: Microsoft-HTTPAPI/2.0
Date: Sat, 08 Dec 2018 01:36:09 GMT
System.Management.Automation.RuntimeException: ErrorAt line:2 char:2
+ throw 'Error'
+ ~~~~~~~~~~~~~
System.Management.Automation.RuntimeException: ErrorAt line:2 char:2
+ throw 'Error'
+ ~~~~~~~~~~~~~
------------------------------------------------------------------
Expected behavior
It should only return the latest error response
Version Information
Run the following script and copy and paste the results here:
Name | Version |
---|---|
Polaris | 0.2.0 |
PSVersion | PSEdition | PSCompatibleVersions | BuildVersion | CLRVersion | WSManStackVersion | PSRemotingProtocolVersion | SerializationVersion |
---|---|---|---|---|---|---|---|
5.1.17134.228 | Desktop | 1.0.-1.-1, 2.0.-1.-1, 3.0.-1.-1, 4.0.-1.-1, 5.0.-1.-1, 5.1.17134.228 | 10.0.17134.228 | 4.0.30319.42000 | 3.0 | 2.3 | 1.1.0.1 |