Skip to content

Commit

Permalink
restrict request method
Browse files Browse the repository at this point in the history
  • Loading branch information
Cycloctane committed Jan 23, 2025
1 parent 9c7e025 commit 4279f77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ const (
)

func httpHandlerFactory(logger *log.Logger) http.HandlerFunc {
return func(w http.ResponseWriter, _ *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
mediaBaseUrl, _ := url.Parse(mediaBasePath)
imageBaseUrl, _ := url.Parse(imageBasePath)
playList, err := mediahandler.GetMedia(mediaBaseUrl, imageBaseUrl)
Expand Down

0 comments on commit 4279f77

Please sign in to comment.