minor relocation of a variable
This commit is contained in:
parent
9c3a4d0c17
commit
a1f8d4cf22
@ -1478,7 +1478,6 @@ func (c *Client) WrapHttpHandler(handler ClientHttpHandler) http.Handler {
|
|||||||
var err error
|
var err error
|
||||||
var start_time time.Time
|
var start_time time.Time
|
||||||
var time_taken time.Duration
|
var time_taken time.Duration
|
||||||
var realm string
|
|
||||||
|
|
||||||
// this deferred function is to overcome the recovering implemenation
|
// this deferred function is to overcome the recovering implemenation
|
||||||
// from panic done in go's http server. in that implemenation, panic
|
// from panic done in go's http server. in that implemenation, panic
|
||||||
@ -1500,6 +1499,8 @@ func (c *Client) WrapHttpHandler(handler ClientHttpHandler) http.Handler {
|
|||||||
if req.Method == http.MethodOptions {
|
if req.Method == http.MethodOptions {
|
||||||
status_code = WriteEmptyRespHeader(w, http.StatusOK)
|
status_code = WriteEmptyRespHeader(w, http.StatusOK)
|
||||||
} else {
|
} else {
|
||||||
|
var realm string
|
||||||
|
|
||||||
status_code, realm = handler.Authenticate(req)
|
status_code, realm = handler.Authenticate(req)
|
||||||
if status_code == http.StatusUnauthorized {
|
if status_code == http.StatusUnauthorized {
|
||||||
if realm != "" {
|
if realm != "" {
|
||||||
|
@ -1182,7 +1182,6 @@ func (s *Server) WrapHttpHandler(handler ServerHttpHandler) http.Handler {
|
|||||||
var err error
|
var err error
|
||||||
var start_time time.Time
|
var start_time time.Time
|
||||||
var time_taken time.Duration
|
var time_taken time.Duration
|
||||||
var realm string
|
|
||||||
|
|
||||||
// this deferred function is to overcome the recovering implemenation
|
// this deferred function is to overcome the recovering implemenation
|
||||||
// from panic done in go's http server. in that implemenation, panic
|
// from panic done in go's http server. in that implemenation, panic
|
||||||
@ -1204,6 +1203,8 @@ func (s *Server) WrapHttpHandler(handler ServerHttpHandler) http.Handler {
|
|||||||
if req.Method == http.MethodOptions {
|
if req.Method == http.MethodOptions {
|
||||||
status_code = WriteEmptyRespHeader(w, http.StatusOK)
|
status_code = WriteEmptyRespHeader(w, http.StatusOK)
|
||||||
} else {
|
} else {
|
||||||
|
var realm string
|
||||||
|
|
||||||
status_code, realm = handler.Authenticate(req)
|
status_code, realm = handler.Authenticate(req)
|
||||||
if status_code == http.StatusUnauthorized {
|
if status_code == http.StatusUnauthorized {
|
||||||
if realm != "" {
|
if realm != "" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user