Skip to content

Commit 4279f77

Browse files
committed
restrict request method
1 parent 9c7e025 commit 4279f77

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/router/router.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ const (
1616
)
1717

1818
func httpHandlerFactory(logger *log.Logger) http.HandlerFunc {
19-
return func(w http.ResponseWriter, _ *http.Request) {
19+
return func(w http.ResponseWriter, r *http.Request) {
20+
if r.Method != http.MethodGet {
21+
w.WriteHeader(http.StatusMethodNotAllowed)
22+
return
23+
}
2024
mediaBaseUrl, _ := url.Parse(mediaBasePath)
2125
imageBaseUrl, _ := url.Parse(imageBasePath)
2226
playList, err := mediahandler.GetMedia(mediaBaseUrl, imageBaseUrl)

0 commit comments

Comments
 (0)