You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-12-01 22:51:45 +02:00
Lint for non-comment linter errors
This commit is contained in:
@@ -46,13 +46,13 @@ func stripParam(param, endpoint string) string {
|
||||
}
|
||||
|
||||
// validateToken returns true if token is valid
|
||||
func validateToken(p Provider, access_token string, header http.Header) bool {
|
||||
if access_token == "" || p.Data().ValidateURL == nil {
|
||||
func validateToken(p Provider, accessToken string, header http.Header) bool {
|
||||
if accessToken == "" || p.Data().ValidateURL == nil {
|
||||
return false
|
||||
}
|
||||
endpoint := p.Data().ValidateURL.String()
|
||||
if len(header) == 0 {
|
||||
params := url.Values{"access_token": {access_token}}
|
||||
params := url.Values{"access_token": {accessToken}}
|
||||
endpoint = endpoint + "?" + params.Encode()
|
||||
}
|
||||
resp, err := api.RequestUnparsedResponse(endpoint, header)
|
||||
@@ -72,8 +72,3 @@ func validateToken(p Provider, access_token string, header http.Header) bool {
|
||||
log.Printf("token validation request failed: status %d - %s", resp.StatusCode, body)
|
||||
return false
|
||||
}
|
||||
|
||||
func updateURL(url *url.URL, hostname string) {
|
||||
url.Scheme = "http"
|
||||
url.Host = hostname
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user