| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6d7876d commit 01f3650
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,8 +47,10 @@ func getAPIKeyFromRequest(c fiber.Ctx) string { | |||
| 47 | 47 | APIKey string `json:"x-api-key" form:"x-api-key" query:"x-api-key"` | |
| 48 | 48 | }{} | |
| 49 | 49 | ||
| 50 | - if err := c.Bind().Body(&payload); err == nil && payload.APIKey != "" { | ||
| 51 | - return payload.APIKey | ||
| 50 | + if c.HasBody() { | ||
| 51 | + if err := c.Bind().Body(&payload); err == nil && payload.APIKey != "" { | ||
| 52 | + return payload.APIKey | ||
| 53 | + } | ||
| 52 | 54 | } | |
| 53 | 55 | ||
| 54 | 56 | if err := c.Bind().Query(&payload); err != nil { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,5 +84,3 @@ func functionName() string { | |||
| 84 | 84 | ||
| 85 | 85 | return strings.ReplaceAll(frame.Function, "github.com/NdoleStudio/http-sms-manager/", "") | |
| 86 | 86 | } | |
| 87 | - | ||
| 88 | - // fiber:context-methods migrated | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments