Skip to content

Base URLs with paths get placed after the "well-known" parts, scrambling URLs. #34

@kshehata

Description

@kshehata

From an issue over at SpruceKit-mobile, if the base URL has a path in it (e.g. http://localhost/draft13 , which is common for Walt.ID) then the "well-known" paths produce something like /.well-known/openid-credential-issuer/draft13 which is just wrong. I'm not sure what the logic here was supposed to be, but the patch below seems to fix it at least in my local testing.

diff --git a/src/util/discoverable.rs b/src/util/discoverable.rs
index cc2ccc5..81cd40c 100644
--- a/src/util/discoverable.rs
+++ b/src/util/discoverable.rs
@@ -46,11 +46,11 @@ fn well_known_uri(base_url: &Uri, well_known: &UriRef) -> UriBuf {
     result.set_authority(base_url.authority());

     let mut path = result.path_mut();
-    for s in well_known.path() {
+    for s in base_url.path() {
         path.push(s);
     }

-    for s in base_url.path() {
+    for s in well_known.path() {
         path.push(s);
     }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions