Skip to content

Commit

Permalink
fix woodpecker-ci#2514 rename contentTypeName->fileName, after feedba…
Browse files Browse the repository at this point in the history
…ck via PR conversation
  • Loading branch information
nitram509 committed Oct 3, 2023
1 parent 95d2690 commit 2c6d753
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ func New() (*gin.Engine, error) {
}

func handleCustomFilesAndAssets(fs *prefixFS) func(ctx *gin.Context) {
serveFileOrEmptyContent := func(w http.ResponseWriter, r *http.Request, localFileName, contentTypeName string) {
serveFileOrEmptyContent := func(w http.ResponseWriter, r *http.Request, localFileName, fileName string) {
if len(localFileName) > 0 {
http.ServeFile(w, r, localFileName)
} else {
// prefer zero content over sending a 404 Not Found
http.ServeContent(w, r, contentTypeName, time.Now(), bytes.NewReader([]byte{}))
http.ServeContent(w, r, fileName, time.Now(), bytes.NewReader([]byte{}))
}
}
return func(ctx *gin.Context) {
Expand Down

0 comments on commit 2c6d753

Please sign in to comment.