File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -233,11 +233,14 @@ type OAuthServerMetadataResponse struct {
233
233
func (s * Server ) OAuthServerMetadata (w http.ResponseWriter , r * http.Request ) error {
234
234
issuer := s .config .JWT .Issuer
235
235
236
- // TODO(cemal) :: Remove this check when we have the config validation in place
236
+ // Basic issuer validation - empty issuer would create broken URLs
237
237
if issuer == "" {
238
238
return apierrors .NewInternalServerError ("Issuer is not set" )
239
239
}
240
240
241
+ // Ensure issuer doesn't end with a slash to avoid double slashes in URLs
242
+ issuer = strings .TrimSuffix (issuer , "/" )
243
+
241
244
response := OAuthServerMetadataResponse {
242
245
Issuer : issuer ,
243
246
AuthorizationEndpoint : fmt .Sprintf ("%s/oauth/authorize" , issuer ),
You can’t perform that action at this time.
0 commit comments