-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
tus-sender: resolveUploadUrl does not work properly when using relative path #246
Comments
thanks @TheMadKow its very clear now what the issue is. |
Thanks @yoavniran :) |
@TheMadKow Just making sure, since you provide a destination without the origin and you want to return an absolute path from your TUS server. This means that the final upload URL will be just the absolute path. Example:
Upload URL will be: This is your expectation, correct? |
@yoavniran - the issue is the exception thrown by the code after initial handshake is establised. If: Destination URL == /Core/HandleTusFiles Upload URL will be: https://localhost:44315/Core/HandleTusFiles/[guid] Currently, the destination URL is relative (/Core/HandleTusFiles), and Location header returns a correct absolute path (location: /Core/HandleTusFiles/dade9da9f5f141b7aa4a8f49cd18ba6b), but afterwards it fails. That is, the first post request works just fine, and returns correct location with status code 201.
Specifically, I think the URL function tries to work with the relative path, and not the provided location from the server. If that's not possible, maybe it's easier to specify that the destination URL should always be absolute. Best, |
The problem is clear and I have a fix for it - #247 |
Thank you ! :) |
0.13.6 is now out. Please check that it does solve the problem. |
Yes, I can confirm it works fine now. |
Describe the bug
While using relative path, first connection with server succeeds, and then fails.
When using url : '/relative-path/files' the client will fail due to the following error
following code lines:
because createUrl variable is relative, and URL function throws an error.
To Reproduce
It's in my code base, maybe the same as issue #242 but with relative path instead of absolute path.
That is -- Use it as a destination: "/files"
Expected behavior
To be able to provide relative path to the server.
Versions
After release 0.13.5 on Chrome/Edge Chromium.
Code
** Doesn't Work with relative URL **
** Works with absolute URL **
The text was updated successfully, but these errors were encountered: