Skip to content

Duplicate Port Number in Fhir Requests #13

@yuekselba

Description

@yuekselba

Hello again :),

I'm facing the problem, that FHIRExtinguisher tries to fetch linked resources by a non valid URL. The port extension :443 gets duplicated.
FHIRExtinguisher tries to request from the URL https://our.fhir.server:443:443/fhir?_getpages=12345...
After some digging in the sources, I found that the nextUrl returned by bundleWrapper.link.find { it.relation == "next" }?.url already is broken.
For a quick fix, I wrote the following patch:

--- a/src/main/kotlin/fhirextinguisher/FhirExtinguisher.kt
+++ b/src/main/kotlin/fhirextinguisher/FhirExtinguisher.kt
@@ -189,7 +189,11 @@ class FhirExtinguisher(
             log.info { "Loading Bundle from $nextUrl" }
             val bundle = fhirClient.fetchResourceFromUrl(bundleClass, nextUrl)
             val bundleWrapper = BundleWrapper(bundleDefintion, bundle)
+
             nextUrl = bundleWrapper.link.find { it.relation == "next" }?.url
+            if (nextUrl != null) {
+                nextUrl = nextUrl.replace(":443:443", ":443")
+            }
             cacheBundleReference(bundleWrapper, columns)
             for (bundleEntry in bundleWrapper.entry) {
                 subtables += processBundleEntry(columns, bundleEntry)

Do you know what goes wrong here? Thank you for your support!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions