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 {
199
199
allowedMethodsHandler := func (next http.Handler , allowedMethods ... string ) http.Handler {
200
200
allowedMethodSet := sets .New [string ](allowedMethods ... )
201
201
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 )
205
205
return
206
206
}
207
207
if ! allowedMethodSet .Has (r .Method ) {
@@ -211,7 +211,7 @@ func (s *LocalDirV1) StorageServerHandler() http.Handler {
211
211
next .ServeHTTP (w , r )
212
212
})
213
213
}
214
- return allowedMethodsHandler (mux , http .MethodGet , http .MethodHead )
214
+ return allowedMethodsHandler (mux , http .MethodGet , http .MethodHead , http . MethodPost )
215
215
}
216
216
217
217
func (s * LocalDirV1 ) handleV1All (w http.ResponseWriter , r * http.Request ) {
You can’t perform that action at this time.
0 commit comments