-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Get-file web server route now support streaming #9078
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for tiddlywiki-previews ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Confirmed: linonetwo has already signed the Contributor License Agreement (see contributing.md) |
📊 Build Size Comparison:
|
Branch | Size |
---|---|
Base (master) | 2527.2 KB |
PR | 2528.5 KB |
Diff: ⬆️ Increase: +1.3 KB
status = 404; | ||
content = "File '" + suppliedFilename + "' not found"; | ||
if(path.relative(baseFilename,filename).indexOf("..") === 0) { | ||
return state.sendResponse(403,{"Content-Type": "text/plain"},"Access denied"); |
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.
Sending a 403 response is not a backwards compatible change. In general I think we should prefer 404 because 403 is apt to reveal information about the existence of resources.
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.
Okay, I also update the put-file for this. Consistent behavior across GET/PUT routes.
Support video Range HTTP header and straming large file. I've tested it, now video in ./files folder can be loaded partially with 206 Partial Content, also allow downloader to resume download things.
This will add more code to the core, so I make it a separate PR incase you don't like it. I currently only need #9075 , and this PR is only a byproduct.
I'm not sure how we could add test for server route. I test this manually with agent like this: