Skip to content

Location URI is wrong when resource id begins with resource type name #2965

@lmsurpre

Description

@lmsurpre

Describe the bug
A clear and concise description of what the bug is.

Environment
main

To Reproduce
Steps to reproduce the behavior:

  1. issue a PUT to {{base}}/Patient/{{id}} with an id like "Patient1"
  2. note the location header in the response

The resource is created successfully, but the location header in the response has an extra /Patient:
https://localhost:9443/fhir-server/api/v4/Patient/Patient/Patient1/_history/1

Expected behavior
The location header should point to the proper absolute url of the created resource

Additional context
When we try to construct the baseUrl from the request, we mistake the /Patient1 for the /Patient segment of the path.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions