Open gibbz00 opened 3 weeks ago
I can see how this would be confusing, and I agree that the sensible result should be http://localhost:9025/jwk
.
As context, I intentionally didn't use Url::join
because (iiuc) it always replaces the last component of the issuer URL unless it has a trailing slash. Since an issuer URL should always be a prefix of the joined URL, we always want to append rather than replace.
The simplest fix is probably to check whether the suffix begins with a /
, and not to insert another /
in the middle if so (similar to the existing check on the issuer URL ending in a /
). If the issuer URL ends in a /
and the suffix starts with a /
, we probably want to skip the duplicate leading slash in the suffix. I don't think any further canonicalization is necessary though (e.g., if there are multiple consecutive slashes in the issuer URL or the suffix).
Thoughts?
Might be related to: #277
Last assertion fails:
https://github.com/ramosbugs/openidconnect-rs/blob/02525323bfdcef1c0da17835fa0d9738db354765/src/types/mod.rs#L310
I'm currently able to work around this by calling
trim_start_matches()
so it not that big of an issue really. Mostly interested if/where I've missed the underlying motivation for this behavior :)