Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fullUrl of whole-system search response bundle entries improperly contain query parameters #1964

Closed
d0roppe opened this issue Feb 17, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@d0roppe
Copy link
Collaborator

d0roppe commented Feb 17, 2021

Describe the bug
After performing a whole-system search with one or more query parameters, the response bundle entries have messed up fullUrl values that contain information from the actual search string

To Reproduce
Steps to reproduce the behavior:

  1. Add some data to a server
  2. Do a whole system search like:
    https://localhost:9443/fhir-server/api/v4?_lastUpdated=ge2021-02-12T16:17:47
  3. The result with a fullUrl looks like this:
"fullUrl": "https://localhost:9443/fhir-server/api/v4?_lastUpdated=ge2021-02-12T16:17:47/Patient/..."

Same issue if you pass in a configured originalRequestUri header (either relative and absolute).

Expected behavior
the whole system search response should contain value fullUrl entries

Additional context

@d0roppe d0roppe added the bug Something isn't working label Feb 17, 2021
@lmsurpre lmsurpre added this to the Sprint 2021-03 milestone Feb 17, 2021
@lmsurpre lmsurpre self-assigned this Feb 17, 2021
@lmsurpre lmsurpre changed the title use of originalRequestUriHeaderName for whole system search is not working properly fullUrl of whole-system search response bundle entries improperly contain query parameters Feb 17, 2021
lmsurpre added a commit that referenced this issue Feb 17, 2021
1. Set originalRequestUriHeaderName to "X-FHIR-FORWARDED-URL" in our
default fhir-server-config (so that this can get tested by our default
CI without flags)
2. Added OriginalRequestRewriteServerTest to ensure this feature is
working as expected
3. Expanded SearchAllTest to include a check for the fullUrl in the
response bundle
4. Fix FHIRRestHelper.getRequestBaseUri(type) in two cases:
  * for certain cases we were setting the baseUri to requestUri
  * strip the `/_search` from the end of the whole-system search URL
when it was invoked via POST

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Feb 18, 2021
1. Set originalRequestUriHeaderName to "X-FHIR-FORWARDED-URL" in our
default fhir-server-config (so that this can get tested by our default
CI without flags)
2. Added OriginalRequestRewriteServerTest to ensure this feature is
working as expected
3. Expanded SearchAllTest to include a check for the fullUrl in the
response bundle
4. Fix FHIRRestHelper.getRequestBaseUri(type) in two cases:
  * for certain cases we were setting the baseUri to requestUri
  * strip the `/_search` from the end of the whole-system search URL
when it was invoked via POST

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Feb 18, 2021
issues #1907 and #1964 - strip the query from originalRequestUri before parsing and fix baseUrl for whole-system queries
@d0roppe
Copy link
Collaborator Author

d0roppe commented Feb 23, 2021

Verified with the change to the header X-FHIR-FORWARDED-URL. now working with full system search

@d0roppe d0roppe closed this as completed Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants