insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

Error: Unrecognized or bad HTTP Content or Transfer-Encoding

Open RobertKlohr opened this issue 3 years ago • 2 comments

Describe the bug When testing a third party API (I don't have any access to the server configuration), instead of displaying the XML file returned by the server Insomnia is throwing the error "Error: Unrecognized or bad HTTP Content or Transfer-Encoding".

Output In renderer.log

[2021-04-14 00:54:57.526] [info]  [network] Sending req=req_b0b89e6532a04d548ad7607d2fdba387 env=env_7df4a9e43c1c42f68e8c6ebcb78742f6
[2021-04-14 00:54:58.468] [info]  [network] Response failed req=req_b0b89e6532a04d548ad7607d2fdba387 err=Error: Unrecognized or bad HTTP Content or Transfer-Encoding

To Reproduce

  1. Send API request to endpoint that triggers a status 500 Internal Server Error response from the server.
  2. Sever responds with a well formed and valid XML response.
  3. See error

Timeline

> POST /API/Ambassador/AmbassadorService HTTP/1.1
> Host: [redacted]
> User-Agent: insomnia/2021.2.2
> Cookie: LP-XSRF-TOKEN=[redacted]; .ASPXAUTH=[redacted]
> Content-Type: text/xml; charset=utf-8
> SOAPAction: LockPath.Keylight.API.SOAP/IBaseService/GetDateTime
> Accept-Encoding: gzip,deflate
> Accept: */*
> Content-Length: 172

| <Envelope
| 	xmlns="http://schemas.xmlsoap.org/soap/envelope/">
| 	<Header/>
| 	<Body>
| 		<GetDateTime
| 			xmlns="LockPath.Keylight.API.SOAP">
| 		</GetDateTime>
| 	</Body>
| </Envelope>

* upload completely sent off: 172 out of 172 bytes
* Mark bundle as not supporting multiuse

< HTTP/1.1 500 Internal Server Error
< Cache-Control: private
< Content-Type: text/xml; charset=utf-8
< Content-Encoding: gzip,gzip
< Server: 

* Replaced cookie .ASPXAUTH="" for domain [redacted] path /, expire 939686400

< Set-Cookie: .ASPXAUTH=; expires=Tue, 12-Oct-1999 00:00:00 GMT; path=/; secure; HttpOnly; SameSite=Lax
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< X-UA-Compatible: IE=edge
< X-Frame-Options: SAMEORIGIN
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< Date: Wed, 14 Apr 2021 07:26:21 GMT
< Content-Length: 608

* Received 608 B chunk
* Error while processing content unencoding: incorrect header check
* Closing connection 89
* TLSv1.2 (OUT), TLS alert, close notify (256):

XML Returned by Server I used SoapUI to retrieve this information with a configuration that matches Insomnia for this API call.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <s:Fault>
         <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode>
         <faultstring xml:lang="en-US">A valid session is required for API access.</faultstring>
         <detail>
            <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
               <HelpLink i:nil="true"/>
               <InnerException i:nil="true"/>
               <Message>A valid session is required for API access.</Message>
               <StackTrace>at LockPath.Keylight.Web.API.BaseService.get_DataSession() in C:\Src\5.8\LockPath.Keylight.Web\API\BaseService.cs:line 73
   at LockPath.Keylight.Web.API.BaseService.ValidateAccess() in C:\Src\5.8\LockPath.Keylight.Web\API\BaseService.cs:line 341
   at LockPath.Keylight.Web.API.BaseServiceInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs) in C:\Src\5.8\LockPath.Keylight.Web\API\BaseServiceInvoker.cs:line 40
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
               <Type>System.Exception</Type>
            </ExceptionDetail>
         </detail>
      </s:Fault>
   </s:Body>
</s:Envelope>

Expected behavior The XML file would be displayed.

Screenshots N/A

Desktop Version: Insomnia 2021.2.2 Release date: 3/29/2021 OS: Windows_NT x64 10.0.19042 Electron: 9.3.5 Node: 12.14.1 V8: 8.3.110.13-electron.0 Architecture: x64 node-libcurl: libcurl/7.73.0-DEV OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.9 WinIDN libssh2/1.9.0_DEV nghttp2/1.41.0

Additional context The only thing that is odd is the "Content-Encoding: gzip,gzip" header in the response. I tried a few combinations of "Accept-Encoding" headers and the response is always the first value in the header but doubled. The exception is if I set the header to "Accept-Encoding:*" and then the response is "Content-Encoding: gzip". In all tests Insomnia returns the same error.

RobertKlohr avatar Apr 14 '21 07:04 RobertKlohr

+1

ghost avatar Apr 29 '21 05:04 ghost

Hi @RobertKlohr thanks for reporting this! Are you by any chance still able to reproduce it in a recent insomnia version, like our latest beta?

filfreire avatar Aug 12 '22 11:08 filfreire

Closing as with no response from user.

kreosus avatar Jan 27 '23 14:01 kreosus

Sorry I missed the question until the close notice came through. I just wanted to say that I would be willing to test, but as I am the consumer of the APIs I use, I don't have way to test a 500 error until one happens. If anyone has a way for me to test against my configuration, post the endpoint here.

RobertKlohr avatar Feb 07 '23 01:02 RobertKlohr