Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 425
lightyrs Avatar asked Apr 22 '26 15:04

lightyrs


1 Answers

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.

like image 56
lightyrs Avatar answered Apr 24 '26 07:04

lightyrs