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

Pathnames in HTTP requests must start with a slash #368

Open
gerjon-eatch opened this issue Oct 8, 2024 · 0 comments
Open

Pathnames in HTTP requests must start with a slash #368

gerjon-eatch opened this issue Oct 8, 2024 · 0 comments
Assignees
Labels
docu documentation

Comments

@gerjon-eatch
Copy link

Some background: The request target in an HTTP request to a server should start with a slash. Some servers may accept requests without the leading slash (interpreting it as if the path started with a slash), but this is non-standard behavior. As it happens, the core of elasticsearch is one server that does this. So when you run the example from your readme, with a PUT _template/my_template resource, this will work fine in a local development environment, with a local elasticsearch cluster, or one spun up from docker. However, once you try the same on a more involved infrastructure, such as an elastic.co managed cloud deployment on GCP, there are load-balancers and/or proxies in front of elasticsearch, that will reject the same resource with a 400 (Bad Request) response. I know, because I just spend a full day debugging why our deployments stopped working once going to an acceptance environment. And it's not just stupid me: this never resolved issue #287 has the same cause: omitting the leading slash from the pathname.

So I suggest to change the examples in your documentation to include the leading slash. In your README.md that means changing PUT _template/my_template into PUT /_template/my_template. It may prevent some users from stumbling into this issue when they follow the documented instructions.

In addition you might just want to silently add the leading slash when they are omitted in (some) script files.

@xtermi2 xtermi2 self-assigned this Oct 8, 2024
@xtermi2 xtermi2 added the docu documentation label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docu documentation
Projects
None yet
Development

No branches or pull requests

2 participants