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

issue #2965 - modify getRequestBaseUri logic #2966

Merged
merged 2 commits into from
Nov 10, 2021
Merged

issue #2965 - modify getRequestBaseUri logic #2966

merged 2 commits into from
Nov 10, 2021

Commits on Nov 10, 2021

  1. issue #2965 - modify getRequestBaseUri logic

    Previously, we looked for the last instnace of `/[resourceType]` in the
    path and assumed that was the first thing after the baseUrl. However, if
    a resourceId happened to match the resource type, this proved erroneous.
    
    The updated logic looks for the first instance of `/[resourceType]/` in
    the path instead.
    If that doesn't exist, then we fall back to the old approach of using
    the last index of `/[resourceType]` (now that we know it should be safe
    to do so).
    
    This updated logic could break if someone insisted on including a
    baseUrl that includes a path segment that matches `/[resourceType]/`
    (e.g. https://example.com/my/Patient/api/ ) but I think that is an
    acceptable risk because that would be very dumb to do.
    
    Alternatives would be to either
    A. rely solely on a configured baseUrl; or
    B. do more processing of the URL to ensure we're stripping a path and
    not a hostname
    
    Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
    lmsurpre committed Nov 10, 2021
    Configuration menu
    Copy the full SHA
    8e17122 View commit details
    Browse the repository at this point in the history
  2. issue #2965 - document known limitation for custom base urls

    and add a test to OriginalRequestRewriteServerTest for the exact
    examples used in the docs
    
    Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
    lmsurpre committed Nov 10, 2021
    Configuration menu
    Copy the full SHA
    3a27bb2 View commit details
    Browse the repository at this point in the history