Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/stallion/corral.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"deps": [
{
"locator": "github.com/ponylang/stallion.git",
"version": "0.6.1"
"version": "0.7.0"
}
]
}
13 changes: 10 additions & 3 deletions docker/stallion/main.pony
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,18 @@ actor OkServer is stallion.HTTPServerActor
request': stallion.Request val,
responder: stallion.Responder)
=>
// Per RFC 9110 §9.3.2 the application is responsible for not
// emitting a body when the request method is HEAD. The headers
// (including Content-Length) match what a GET would produce; only
// the body section is suppressed.
let body: String val = "ok\n"
let response = stallion.ResponseBuilder(stallion.StatusOK)
let builder = stallion.ResponseBuilder(stallion.StatusOK)
.add_header("Content-Type", "text/plain")
.add_header("Content-Length", body.size().string())
.finish_headers()
.add_chunk(body)
.build()
let response =
match request'.method
| stallion.HEAD => builder.build()
else builder.add_chunk(body).build()
end
responder.respond(response)
Loading