Skip to content

Commit

Permalink
fix unathorized response
Browse files Browse the repository at this point in the history
  • Loading branch information
juanhuttemann committed May 14, 2021
1 parent afe2026 commit f118c21
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion handlers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ func AuthAPI(c *fiber.Ctx) {
key := c.Get("x-api-key")
if db.GetApiKey() == key {
c.Next()
} else {
c.JSON(fiber.Map{
"message": "Unauthorized, please correct the api key of the target host",
"status": http.StatusUnauthorized,
})
}
c.SendStatus(http.StatusUnauthorized)
}

//Bandwidth returns a JSON response of the Bandwidth information
Expand Down
2 changes: 1 addition & 1 deletion images/release.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func StartMessage(protocol, port string) {
/ / / / / / _ \ / // __// __/
/ / / /_//_//_/ \__//_/
/____________/ /
\____________\/ v0.6.4
\____________\/ v0.6.5
Go to admin panel at %v://localhost:%v
Expand Down
8 changes: 4 additions & 4 deletions versioninfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
"FileVersion": {
"Major": 0,
"Minor": 6,
"Patch": 4
"Patch": 5
},
"ProductVersion": {
"Major": 0,
"Minor": 6,
"Patch": 4
"Patch": 5
}
},
"StringFileInfo": {
"CompanyName": "Bit Cavalier",
"FileDescription": "Nitr is a cross-platform remote monitoring tool written in Golang for system information gathering, making it available through a JSON API.",
"FileVersion": "v0.6.4",
"FileVersion": "v0.6.5",
"InternalName": "nitr.exe",
"LegalCopyright": "Copyright (c) 2021 Bit Cavalier",
"LegalTrademarks": "",
"OriginalFilename": "nitr.exe",
"PrivateBuild": "",
"ProductName": "nitr",
"ProductVersion": "v0.6.4",
"ProductVersion": "v0.6.5",
"SpecialBuild": ""
},
"VarFileInfo": {
Expand Down

0 comments on commit f118c21

Please sign in to comment.