Skip to content

Conversation

driusan
Copy link
Collaborator

@driusan driusan commented Sep 25, 2025

The BaseRouter/Prefix router stripped off the handled part of the URI before passing it to other handlers. The reasoning was that then the modules could treat the request without regard to the location that LORIS is being served for and act as if it's always the root.

However, in practice this causes more problems than it solves. The original URI is lost completely, so middleware, error pages, and http headers that may need it do not have access to it without reconstructing it.

This updates the handled part of the URI to go into an "unhandledURI" attribute while leaving the request->getURI untouched. Doing so allows us to access the original URI when needed and if ie. you print $request->getURI() in an error message you will get the correct value.

@github-actions github-actions bot added Language: PHP PR or issue that update PHP code Module: statistics PR or issue related to statistics module Module: api PR or issue related to api module Module: candidate_profile PR or issue related to candidate_profile module labels Sep 25, 2025
@github-actions github-actions bot added the Module: conflict_resolver PR or issue related to conflict_resolver module label Sep 25, 2025
@driusan driusan force-pushed the GetURIRefactor branch 3 times, most recently from 049e25a to 797004c Compare September 25, 2025 17:15
The BaseRouter/Prefix router stripped off the handled part of the URI
before passing it to other handlers. The reasoning was that then the
modules could treat the request without regard to the location that LORIS
is being served for and act as if it's always the root.

However, in practice this causes more problems than it solves. The original
URI is lost completely, so middleware, error pages, and http headers that may
need it do not have access to it without reconstructing it.

This updates the handled part of the URI to go into an "unhandledURI" attribute
while leaving the request->getURI untouched. Doing so allows us to access
the original URI when needed and if ie. you print $request->getURI() in an
error message you will get the correct value.
@github-actions github-actions bot added the Module: instruments PR or issue related to instruments module label Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language: PHP PR or issue that update PHP code Module: api PR or issue related to api module Module: candidate_profile PR or issue related to candidate_profile module Module: conflict_resolver PR or issue related to conflict_resolver module Module: instruments PR or issue related to instruments module Module: statistics PR or issue related to statistics module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants