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

Trailing slashes not allowed in URLs #7

Open
benfrancis opened this issue Jul 29, 2022 · 2 comments
Open

Trailing slashes not allowed in URLs #7

benfrancis opened this issue Jul 29, 2022 · 2 comments

Comments

@benfrancis
Copy link

Just a small thing, and it's probably spec compliant, but this caught me out when I wasn't sure why I kept getting 404 responses.

A GET request on /things works, but a request on /things/ returns a 404.

@relu91
Copy link
Contributor

relu91 commented Jul 29, 2022

Just found out that the Fastify router does not enable by default ignoreTrailingSlashes. We can enable them as described here: https://morioh.com/p/bcdbef588277. However, now I wonder which is the correct behavior. Is it standard to ignore the trailing slashes? Is it something that we should tackle in the WoT Discovery spec?

@benfrancis
Copy link
Author

I guess technically there should be a 301 redirect from one to the other. And since /things is what's in the specification, it should probably redrect /things/ to /things. Whether or not WoT Consumers will follow the redirect is another matter, though that's another good reason not to disallow redirect responses!

We sidestep this kind of issue in the protocol bindings in WoT Profile by not specifying hard coded paths, which is what I personally think WoT Discovery should have done. But given it does specifiy paths, it might have to deal with issues like this more explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants