epimorphics / elda

Epimorphics implementation of the Linked Data API
Other
53 stars 27 forks source link

Elda 2.0.1 computes incorrect page URI if api:base is null or empty #220

Open skwlilac opened 4 years ago

skwlilac commented 4 years ago

The root cause of a problem reported on linked-data-api-discuss[1] turns out to be that in the case where the api spec does not set an api:base (and in the case where api:base is set to the empty string) Elda computes the incorrect value for the request page.

The problem lies in RouterRestlet and was introduced by commit

309611e0f70425527ca12abab2dcb858dbe066bb

as part of the work to make elda responsive to forwarding headers.

The correct behaviour in these cases is for elda to use the request URI as received and to override protocol and host with values from the forwarding headers if present.

[1] https://groups.google.com/d/msg/linked-data-api-discuss/9qtbPYCAutQ/7FpxxkQoDwAJ

skwlilac commented 4 years ago

An alternative fix to the presenting issue is to specify and api:base value in the standalone api spec.