minor relocation of a variable

This commit is contained in:
hyung-hwan 2025-04-07 15:24:02 +09:00
parent 9c3a4d0c17
commit a1f8d4cf22
2 changed files with 4 additions and 2 deletions

View File

@ -1478,7 +1478,6 @@ func (c *Client) WrapHttpHandler(handler ClientHttpHandler) http.Handler {
var err error
var start_time time.Time
var time_taken time.Duration
var realm string
// this deferred function is to overcome the recovering implemenation
// 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 {
status_code = WriteEmptyRespHeader(w, http.StatusOK)
} else {
var realm string
status_code, realm = handler.Authenticate(req)
if status_code == http.StatusUnauthorized {
if realm != "" {

View File

@ -1182,7 +1182,6 @@ func (s *Server) WrapHttpHandler(handler ServerHttpHandler) http.Handler {
var err error
var start_time time.Time
var time_taken time.Duration
var realm string
// this deferred function is to overcome the recovering implemenation
// 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 {
status_code = WriteEmptyRespHeader(w, http.StatusOK)
} else {
var realm string
status_code, realm = handler.Authenticate(req)
if status_code == http.StatusUnauthorized {
if realm != "" {