Re: HTTP request status text is changed


Daniel Mikusa
 

Are you sure the request is actually making it to your app? Requests that
come into CF go through a load balancer and the gorouters before they hit
your app. ie. browser -> your LB -> gorouters -> app.

If the upload is too large for the LB or gorouter it would probably
generate a 413 with the standard response.

Take a look at the access logs for your app and for the gorouter (i.e. RTR
tag in `cf logs`). If you don't see either, it's your LB. If you just see
the RTR then it's the gorouter. If you see access log from your app then
it is hitting your app and it would seem that something else is causing
this.

Dan

On Mon, Apr 25, 2016 at 9:25 AM, Stanley Shen <meteorping(a)gmail.com> wrote:

Hello all

I am having an web application running on CF/Diego with version 233, and I
notice strange thing about my APP.
I have some code to check attachments will be uploaded to system.

If the attachment doesn't pass the checking, we will use code like
response.sendError(413, "The file cannot be uploaded due to file extension
jar ")
Where response is HttpServletResponse.

In front end, we have file upload widget to try to upload file to system.

Before, we can always get statusText which is what we set in response,
like "The file cannot be uploaded due to file extension jar"
But right now, I always get statusText "Request Entity Too Large", which
is the standard status text of error code 413.
I tried in non CF environment, and it works as expected.

It looks like in somewhere CF changed the statusText based on the
statusCode, but I didn't get clue yet.

Any information about this?

Thanks in advance.





Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.