fix: process error content type

This commit is contained in:
2023-12-22 15:08:24 +08:00
parent b1e3a97aad
commit fc5a8d55fa
2 changed files with 12 additions and 8 deletions

14
main.go
View File

@@ -105,12 +105,14 @@ func main() {
Authorization: c.Request.Header.Get("Authorization"),
UserAgent: c.Request.Header.Get("User-Agent"),
}
defer func() {
if err := recover(); err != nil {
log.Println("Error:", err)
c.AbortWithError(500, fmt.Errorf("%s", err))
}
}()
/*
defer func() {
if err := recover(); err != nil {
log.Println("Error:", err)
c.AbortWithError(500, fmt.Errorf("%s", err))
}
}()
*/
// check authorization header
if !*noauth {