Malformed response headers

Hi,

My Origin and edge servers are behind AWS Load balancers respectively. Whenever there is a 200 response from WCS server, the Load balancer returns response witn 200 HTTP code.

But when the WCS server returns 404 or 401, then the Load balancer returns 502 or 503 respectively which means LB can't able to identify the response headers from the WCS server.

For ex:
1) On accessing the WCS server endpoint directly
https://forum.flashphoner.com/attac...g.1778/?hash=d680fbf6a28bc171835398f8edd95c33
2) On accessing the WCS server behind LB
https://forum.flashphoner.com/attachments/albaccess-png.1779/?hash=d680fbf6a28bc171835398f8edd95c33

This is not only for this request, even for all REST API requests.
On checking the issue, I found this post https://forums.aws.amazon.com/thread.jspa?threadID=94483. Please check the second message from bottom where if the response from the application is malformed or if it contains invalid headers then Load balancer can't able to parse the requests.
https://aws.amazon.com/premiumsupport/knowledge-center/load-balancer-http-502-errors/

So I think the reponse from WCS servers should be returned with valid headers. Can you check into this please?
 

Attachments

Max

Administrator
Staff member
Good day.
We raised the ticket WCS-2841 to fix the issue with 404 response, and let you know here when fix will be available.
This is not only for this request, even for all REST API requests.
It's not a good idea to send REST API queries through LB, you cannot suppose what instance responds on such query.
REST API queries should be sent directly to instances.
 

Max

Administrator
Staff member
Good day.
We added the following headers to 401, 404 and other error responses in build 5.2.729:
Code:
< HTTP/1.1 401 Unauthorized
< Access-Control-Allow-Origin: *
< Server: Flashphoner/5.2
< Connection: Keep-Alive
< Content-Length: 0
If response has any content, it looks like
Code:
< HTTP/1.1 400 Bad Request
< Access-Control-Allow-Origin: *
< Server: Flashphoner/5.2
< Connection: Keep-Alive
< Content-Length: 219
< Content-Type: application/json
Please update and check.
 
Top