File tree Expand file tree Collapse file tree
internal/catalogd/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -232,9 +232,9 @@ func (s *LocalDirV1) StorageServerHandler() http.Handler {
232232 allowedMethodsHandler := func (next http.Handler , allowedMethods ... string ) http.Handler {
233233 allowedMethodSet := sets .New [string ](allowedMethods ... )
234234 return http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
235- // Allow POST requests for GraphQL endpoint
236- if r .URL .Path != "" && r .URL .Path [len (r .URL .Path )- 7 :] = = "graphql" && r .Method == http .MethodPost {
237- next . ServeHTTP (w , r )
235+ // Allow POST requests only for GraphQL endpoint
236+ if r .URL .Path != "" && r .URL .Path [len (r .URL .Path )- 7 :] ! = "graphql" && r .Method == http .MethodPost {
237+ http . Error (w , http . StatusText ( http . StatusMethodNotAllowed ), http . StatusMethodNotAllowed )
238238 return
239239 }
240240 if ! allowedMethodSet .Has (r .Method ) {
@@ -244,7 +244,7 @@ func (s *LocalDirV1) StorageServerHandler() http.Handler {
244244 next .ServeHTTP (w , r )
245245 })
246246 }
247- return allowedMethodsHandler (mux , http .MethodGet , http .MethodHead )
247+ return allowedMethodsHandler (mux , http .MethodGet , http .MethodHead , http . MethodPost )
248248}
249249
250250func (s * LocalDirV1 ) handleV1All (w http.ResponseWriter , r * http.Request ) {
You can’t perform that action at this time.
0 commit comments