GoogleChromeLabs / simplehttp2server

A simple HTTP/2 server for development
Other
1.74k stars 99 forks source link

Patch HTTP method missing in Access-Control-Allowed-Methods header property #2

Closed lozandier closed 8 years ago

lozandier commented 8 years ago

The Problem

On line 83 of simplehttp2server.go it seems PATCH is omitted in a context that it shouldn't.

Side-effect

Unless it's simply not supported as I think it is, PATCH being omitted can unexpectedly break the Principle of Least Astonishment when partially updating representation of resources on the server with a set of operations or the resource sent back itself.

The Suggestion Action

If I'm correct, Line 83 can be changed to the following:

w.Header().Set("Access-Control-Allow-Methods", "GET, OPTION, HEAD, PUT, PATCH, POST, DELETE")
surma commented 8 years ago

Sorry for the late reply. My emails got filtered the wrong way :confused:

You are totally right, will fix :)