* More sensical CORSMethodMiddleware
* Only sets Access-Control-Allow-Methods on valid preflight requests
* Does not return after setting the Access-Control-Allow-Methods header
* Does not append OPTIONS header to Access-Control-Allow-Methods
regardless of whether there is an OPTIONS method matcher
* Adds tests for the listed behavior
* Add example for CORSMethodMiddleware
* Do not check for preflight and add documentation to the README
* Use http.MethodOptions instead of "OPTIONS"
* Add link to CORSMethodMiddleware section to readme
* Add test for unmatching route methods
* Rename CORS Method Middleware to Handling CORS Requests in README
* Link CORSMethodMiddleware in README to godoc
* Break CORSMethodMiddleware doc into bullets for readability
* Add comment about specifying OPTIONS to example in README for CORSMethodMiddleware
* Document cURL command used for testing CORS Method Middleware
* Update comment in example to "Handle the request"
* Add explicit comment about OPTIONS matchers to CORSMethodMiddleware doc
* Update circleci config to only check gofmt diff on latest go version
* Break up gofmt and go vet checks into separate steps.
* Use canonical circleci config
Previously, when searching for a match, matchErr would be erroneously set, and prevent middleware from running (no match == no middleware runs).
This fix clears matchErr before traversing the next subrouter in a multi-subrouter router.
CORSMethodMiddleware sets the Access-Control-Allow-Methods response header
on a request, by matching routes based only on paths. It also handles
OPTIONS requests, by settings Access-Control-Allow-Methods, and then
returning without calling the next HTTP handler.