handle head requests
This commit is contained in:
parent
eb6418bc97
commit
fd64cadc4e
1 changed files with 5 additions and 0 deletions
5
main.go
5
main.go
|
@ -94,6 +94,7 @@ func main() {
|
|||
r.Use(cors.New(corsConfig))
|
||||
r.POST("/api/claim/publish", publish)
|
||||
r.GET("/*url", view)
|
||||
r.HEAD("/*url", view)
|
||||
r.MaxMultipartMemory = 8 << 20 // 8 MiB
|
||||
r.Run(":5000")
|
||||
}
|
||||
|
@ -115,6 +116,10 @@ func view(c *gin.Context) {
|
|||
_ = c.AbortWithError(http.StatusBadRequest, fmt.Errorf("invalid url: %s", c.Param("url")))
|
||||
return
|
||||
}
|
||||
if c.Request.Method == http.MethodHead {
|
||||
c.AbortWithStatus(200)
|
||||
return
|
||||
}
|
||||
|
||||
resizeParams := ""
|
||||
redirectBaseURL := "https://lbry2.vanwanet.com/speech/"
|
||||
|
|
Loading…
Reference in a new issue