File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
internal/catalogd/storage Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -199,9 +199,9 @@ func (s *LocalDirV1) StorageServerHandler() http.Handler {
199199 allowedMethodsHandler := func (next http.Handler , allowedMethods ... string ) http.Handler {
200200 allowedMethodSet := sets .New [string ](allowedMethods ... )
201201 return http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
202- // Allow POST requests for GraphQL endpoint
203- if r .URL .Path != "" && r .URL .Path [len (r .URL .Path )- 7 :] = = "graphql" && r .Method == http .MethodPost {
204- next . ServeHTTP (w , r )
202+ // Allow POST requests only for GraphQL endpoint
203+ if r .URL .Path != "" && r .URL .Path [len (r .URL .Path )- 7 :] ! = "graphql" && r .Method == http .MethodPost {
204+ http . Error (w , http . StatusText ( http . StatusMethodNotAllowed ), http . StatusMethodNotAllowed )
205205 return
206206 }
207207 if ! allowedMethodSet .Has (r .Method ) {
@@ -211,7 +211,7 @@ func (s *LocalDirV1) StorageServerHandler() http.Handler {
211211 next .ServeHTTP (w , r )
212212 })
213213 }
214- return allowedMethodsHandler (mux , http .MethodGet , http .MethodHead )
214+ return allowedMethodsHandler (mux , http .MethodGet , http .MethodHead , http . MethodPost )
215215}
216216
217217func (s * LocalDirV1 ) handleV1All (w http.ResponseWriter , r * http.Request ) {
You can’t perform that action at this time.
0 commit comments