-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix file serving for files with absolute paths #586
Conversation
I don't see this issue on |
That still works because the file you're using is in the jobs directory. Try one on your desktop, for example. |
Indeed! Moving the |
That is what I meant to do, yes. But I admit it's a little confusing/disappointing. The # https://github.com/NVIDIA/DIGITS/blob/v3.2.0/digits/views.py#L319-L328
def serve_file(path):
"""
Return a file in the jobs directory
If you install the nginx.site file, nginx will serve files instead
and this path will never be used
"""
jobs_dir = config_value('jobs_dir')
return flask.send_from_directory(jobs_dir, path) |
if relative: | ||
path = os.path.relpath(path, config_value('jobs_dir')) | ||
if relative: | ||
path = os.path.relpath(path, config_value('jobs_dir')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated with this change but that code duplication makes it look like Task
and Job
classes could share a common ancestor
Beside #593 the change looks good to me and is working for me. |
Fix file serving for files with absolute paths
Bug reported at https://groups.google.com/d/msg/digits-users/MW_kHbOEqNo/y7wXpvlSFAAJ
To reproduce: