-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Trying to get a static file behind a directory symlink will return a 404 error, despite being able to browse the directory when directory_view=True is used.
Code snippet
app.static("/static", "directory_with_a_directory_symlink/", directory_view=True)Expected Behavior
Serve the file, don't return 404.
How do you run Sanic?
As a module
Operating System
Linux
Sanic Version
25.3.0
Additional context
For example, have a directory structure like this:
.
├── app.py
├── static
│ ├── myfiles -> (symlink to ../myfiles/)
└── myfiles
├── myfile1.txt
├── myfile2.txt
└── myfile3.txt
Have Sanic serve the static directory:
app.static("/", "static/", directory_view=True)When you now run the app and go to /myfiles you can see the files in the myfiles directory, however when you click on any of the files 404 Not Found error is returned.