Currently, the gateway-extension service sends search requests to FHIR JPA servers using HTTP GET. However, these requests can result in URLs that are too long, causing the server to return a 414 Request-URI Too Large error.
Previously, we handled this issue by increasing the nginx large_client_header_buffers value. However, this solution only works for servers with ingress enabled. The server-snippet is specifically an NGINX ingress controller annotation, so it wouldn’t be applicable if we're not using the ingress controller hence we cannot adjust the large_client_header_buffers setting when ingress.enabled is set to false.
To resolve this, we will switch to using HTTP POST for search requests. This change will ensure that search parameters are transmitted in the request body instead of the URL, preventing the 414 error and giving us better control within the gateway-extension application.
Implementation Details
[ ] Update the gateway-extension service to use HTTP POST for FHIR search requests.
[ ] Use the usingStyle(SearchStyleEnum.POST) method to force the use of HTTP POST.
[ ] Ensure that the change applies to all search implementations in the gateway-extension application.
Description
Currently, the gateway-extension service sends search requests to FHIR JPA servers using HTTP GET. However, these requests can result in URLs that are too long, causing the server to return a
414 Request-URI Too Large
error.Previously, we handled this issue by increasing the nginx
large_client_header_buffers
value. However, this solution only works for servers with ingress enabled. The server-snippet is specifically an NGINX ingress controller annotation, so it wouldn’t be applicable if we're not using the ingress controller hence we cannot adjust the large_client_header_buffers setting when ingress.enabled is set to false.To resolve this, we will switch to using HTTP POST for search requests. This change will ensure that search parameters are transmitted in the request body instead of the URL, preventing the
414
error and giving us better control within the gateway-extension application.Implementation Details
usingStyle(SearchStyleEnum.POST)
method to force the use of HTTP POST.Example Implementation
Acceptance Criteria
414 Request-URI Too Large
errors.Additional Information
Related issues
https://github.com/onaio/fhir-gateway-extension/issues/69