Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Refactor Authorization Header Retrieval in Proxy Function (#222)
Browse files Browse the repository at this point in the history
- Updated the Proxy function in common.go to use the GetAccessTokenFromHeader method for setting the Authorization header.
- This change aligns the Proxy function with the updated method of retrieving the access token from either the Authorization or X-Authorization header.
  • Loading branch information
Ariesly authored Jul 14, 2023
1 parent 55e3a27 commit 3ac6ccc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func Proxy(c *gin.Context) {
req, _ = http.NewRequest(method, url, bytes.NewReader(body))
}
req.Header.Set("User-Agent", UserAgent)
req.Header.Set("Authorization", GetAccessToken(c.GetHeader(AuthorizationHeader)))
req.Header.Set("Authorization", GetAccessTokenFromHeader(c.Request.Header))
resp, err := Client.Do(req)
if err != nil {
c.AbortWithStatusJSON(http.StatusInternalServerError, ReturnMessage(err.Error()))
Expand Down

0 comments on commit 3ac6ccc

Please sign in to comment.