mirror of
https://github.com/ncarlier/webhookd.git
synced 2024-09-20 08:55:28 +00:00
feat(): adding HTTP PATCH support to API calls
Co-authored-by: Michael Vallaly <mike.vallaly@alphaeon.com>
This commit is contained in:
parent
3559f1faea
commit
bc1de4e5da
|
@ -47,7 +47,7 @@ func routes(conf *config.Config) Routes {
|
||||||
route(
|
route(
|
||||||
"/",
|
"/",
|
||||||
index,
|
index,
|
||||||
middlewares.UseBefore(middleware.Methods("GET", "POST"))...,
|
middlewares.UseBefore(middleware.Methods("GET", "PATCH", "POST"))...,
|
||||||
),
|
),
|
||||||
route(
|
route(
|
||||||
staticPath,
|
staticPath,
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
func Cors(inner http.Handler) http.Handler {
|
func Cors(inner http.Handler) http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS")
|
w.Header().Set("Access-Control-Allow-Methods", "PATCH, POST, GET, OPTIONS")
|
||||||
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, Authorization")
|
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, Authorization")
|
||||||
|
|
||||||
if r.Method != "OPTIONS" {
|
if r.Method != "OPTIONS" {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user