question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] url with slash

See original GitHub issue

the api docs url (http://127.0.0.1:8000/docs) , if have a slash in the end(just like http://127.0.0.1:8000/docs/ ), will not found 404.

"GET /docs/ HTTP/1.1" 404 Not Found

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dmontagucommented, Dec 30, 2019

This is an issue with starlette. I’m not 100% sure, but I think starlette may recently fixed this so you get a redirect to remove the / (I believe it has supported adding the / with a redirect for a while now).

Either way, if you want to ensure it works both ways, you can specify docs_url="/docs/?" in when creating the FastAPI instance.

0reactions
tiangolocommented, Feb 17, 2020

Thanks for the help @dmontagu ! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Double slash in URL" error in Site Audit | Help Center - Ahrefs
This issue reports all URLs that contain a double slash (after the domain part). Example: https://ahrefs.com/blog//. Why is it important? Most servers are ......
Read more >
[BUG] URL slash encoded #791 - tiangolo/fastapi - GitHub
Describe the bug FastAPI is not routing URL containing slash encoded. To Reproduce Create a file with: from fastapi import FastAPI app ...
Read more >
Small bug if instance url ends with a / (slash) - WordPress.org
I entered my instance URL with a trailing / and this caused the plugin not to display the Peertube playlist properly. The message...
Read more >
Issue 500610: URLs that start with slash+backslash ... - Monorail
Perform a request to any server which must responds with a 302 or 303 status code with the following HTTP Location header (leading...
Read more >
file:// URL - convert 4 slash UNC's to 5 slashes (promote the ...
It's a bug that'll cause us to not use mozilla and instead use IE or ... But URLs must be specified with forward...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found