Search code examples
ruby-on-railshttpnginxunicornpuma

Rails sending HTTP status code without status message


I have a basic JSON error responder:

format.json { render json: errors, status: :unprocessable_entity }

In development, running Puma, I get back:

Status Code: 422 Unprocessable Entity

In production, running Unicorn, I get back:

Status Code: 422

Can anyone think of a reason that the message would be missing?


Solution

  • Rails sending HTTP status code without status message

    is the correct answer in this case.

    Once I switched on the 'Protocol' column in Chrome Dev Tools, I was able to see that I was using HTTP/2, which would explain the lack of reason phrases.

    toggle protocol column

    h2

    Thank you Julian Reschke.