-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
Prior to commit e557721, it was easy to send a custom error message to the client:
conn->error(conn, HTTP_STATUS_BAD_REQUEST, "I cannot understand this POST data.\n");would give:
$ curl localhost:8000 -d zborglh
I cannot understand this POST data.Since that commit, the error() method is no longer available. Instead, we have a new method called send_error(), which always sends an empty body:
conn->send_error(conn, HTTP_STATUS_BAD_REQUEST, "I cannot understand this POST data.");gives:
$ curl localhost:8000 -d zborglh
$ # ← empty response bodyInspecting the full response, it appears the custom message is sent, but it is sent as the status text:
$ curl -i localhost:8000 -d zborglh
HTTP/1.1 400 I cannot understand this POST data.
Server: Libuhttpd/3.14.1
Content-Length: 0
Content-Type: text/plain
Connection: close
A custom status text is far less useful than a custom message within the response body. Would you please consider restoring the functionality of the previous error() method?
Metadata
Metadata
Assignees
Labels
No labels