[Kibana Dev Server] Fix DELETE requests without a body in Safari (#220899)

Recently, we discovered that a `DELETE` request to one of our ML
endpoints does not work correctly in Safari.
After further investigation, it turns out that `DELETE` requests without
a body fail in Safari.
The issue occurs only within the Kibana Dev server, so there is no
impact on end users.
This is most likely due to a header set in the
`packages/kbn-cli-dev-mode/src/base_path_proxy/http1.ts` file. The issue
mentioned in the comment has already been resolved, and everything
appears to work correctly without this outdated workaround.

To reproduce the error:
1. Start Kibana locally and open it with Safari.
2. Find an endpoint that uses the `DELETE` method and does not have a
body specified.
3. ^ For example, go to Observability -> Cases and create a new case.
4. Go back to the cases list and try to delete the case
This commit is contained in:
Robert Jaszczurek 2025-05-20 09:35:30 +02:00 committed by GitHub
parent 2dba27e8ba
commit fa0500c346
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -126,12 +126,6 @@ export class Http1BasePathProxyServer implements BasePathProxyServer {
xforward: true,
mapUri: async (request: Request) => {
return {
// Passing in this header to merge it is a workaround until this is fixed:
// https://github.com/hapijs/h2o2/issues/124
headers:
request.headers['content-length'] != null
? { 'content-length': request.headers['content-length'] }
: undefined,
uri: Url.format({
hostname: request.server.info.host,
port: this.devConfig.basePathProxyTargetPort,