Skip to content

Commit

Permalink
jhttp: advertise Accept-Post in bridge responses
Browse files Browse the repository at this point in the history
  • Loading branch information
creachadair committed Feb 19, 2022
1 parent c826713 commit 90e8e7f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jhttp/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ func (b Bridge) ServeHTTP(w http.ResponseWriter, req *http.Request) {
// If no parse hook is defined, insist that the method is POST and the
// content-type is application/json. Setting a hook disables these checks.
if b.parseReq == nil {
// Advertise that we accept POST application/json.
w.Header().Set("Accept-Post", "application/json")

if req.Method != "POST" {
w.WriteHeader(http.StatusMethodNotAllowed)
return
Expand Down

0 comments on commit 90e8e7f

Please sign in to comment.