Commit b1cf4464 authored by Vijay Kumar Chauhan's avatar Vijay Kumar Chauhan
Browse files

Merge branch 'SG_HttpStatusCode' into 'devbranch'

#24 status code changed from 412 to 401

See merge request !285
parents 5c31ae9e 745d624a
2 merge requests!288Release v1.2.16,!285#24 status code changed from 412 to 401
Showing with 6 additions and 5 deletions
// +build fasthttp //go:build fasthttp
// +build fasthttp
package routebuildermdl package routebuildermdl
...@@ -225,7 +226,7 @@ func RestrictedHandler(c *routing.Context) error { ...@@ -225,7 +226,7 @@ func RestrictedHandler(c *routing.Context) error {
if extractError != nil { if extractError != nil {
loggermdl.LogError(extractError) loggermdl.LogError(extractError)
_, err := c.WriteString(extractError.Error()) _, err := c.WriteString(extractError.Error())
c.SetStatusCode(412) c.SetStatusCode(http.StatusUnauthorized)
return err return err
} }
commonHandler(c, true, false, false, pricipalObj) commonHandler(c, true, false, false, pricipalObj)
...@@ -239,7 +240,7 @@ func RoleBasedHandler(c *routing.Context) error { ...@@ -239,7 +240,7 @@ func RoleBasedHandler(c *routing.Context) error {
if extractError != nil { if extractError != nil {
loggermdl.LogError(extractError) loggermdl.LogError(extractError)
_, err := c.WriteString(extractError.Error()) _, err := c.WriteString(extractError.Error())
c.SetStatusCode(412) c.SetStatusCode(http.StatusUnauthorized)
return err return err
} }
commonHandler(c, true, true, false, pricipalObj) commonHandler(c, true, true, false, pricipalObj)
...@@ -262,7 +263,7 @@ func HeavyRestrictedHandler(c *routing.Context) error { ...@@ -262,7 +263,7 @@ func HeavyRestrictedHandler(c *routing.Context) error {
if extractError != nil { if extractError != nil {
loggermdl.LogError(extractError) loggermdl.LogError(extractError)
_, err := c.WriteString(extractError.Error()) _, err := c.WriteString(extractError.Error())
c.SetStatusCode(412) c.SetStatusCode(http.StatusUnauthorized)
return err return err
} }
commonHandler(c, true, false, true, pricipalObj) commonHandler(c, true, false, true, pricipalObj)
...@@ -276,7 +277,7 @@ func HeavyRoleBasedHandler(c *routing.Context) error { ...@@ -276,7 +277,7 @@ func HeavyRoleBasedHandler(c *routing.Context) error {
if extractError != nil { if extractError != nil {
loggermdl.LogError(extractError) loggermdl.LogError(extractError)
_, err := c.WriteString(extractError.Error()) _, err := c.WriteString(extractError.Error())
c.SetStatusCode(412) c.SetStatusCode(http.StatusUnauthorized)
return err return err
} }
commonHandler(c, true, true, true, pricipalObj) commonHandler(c, true, true, true, pricipalObj)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment