add: server shutdown, tests
This commit is contained in:
@@ -29,15 +29,15 @@ func (mc *MembershipController) RegisterSubscription(c *gin.Context) {
|
||||
}
|
||||
|
||||
logger.Info.Printf("Using API key: %v", config.Auth.APIKEY)
|
||||
|
||||
if regData.APIKey == "" {
|
||||
logger.Error.Println("API Key is missing")
|
||||
c.JSON(http.StatusBadRequest, "API Key is missing")
|
||||
c.JSON(http.StatusUnauthorized, "API Key is missing")
|
||||
return
|
||||
}
|
||||
|
||||
if regData.APIKey != config.Auth.APIKEY {
|
||||
logger.Error.Printf("API Key not valid: %v", regData.APIKey)
|
||||
c.JSON(http.StatusExpectationFailed, "API Key is missing")
|
||||
c.JSON(http.StatusUnauthorized, "API Key is missing")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user