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.

tus-sender: resolveUploadUrl does not work properly when using relative path

See original GitHub issue

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

tusSender.create: create upload failed TypeError: Failed to construct ‘URL’: Invalid URL at resolveUploadUrl (createUpload.js:12) at handleSuccessfulCreateResponse (createUpload.js:24) at createUpload.js:79

following code lines:

    //absolute location, concatenate to upload URL without any other path
    uploadUrl = new URL(createUrl).origin.replace(/\/$/, "") + location;

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 **

        <TusUploady
            destination={{
                url: '/Core/HandleTusFiles',
....

</TusUploady>

** Works with absolute URL **

        <TusUploady
            destination={{
                url: 'https://localhost:44315/Core/HandleTusFiles',
....

</TusUploady>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
TheMadKowcommented, Oct 7, 2021

Yes, I can confirm it works fine now. Thank you for the quick fix !

0reactions
yoavnirancommented, Oct 6, 2021

0.13.6 is now out. Please check that it does solve the problem. thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - relative paths not functioning after site files ...
The site files and folders are located in a directory named "httpdocs". It now seems my relative path links are broken. Using the...
Read more >
Absolute vs. Relative Path URLs in HTML - CIS Sandbox
In the world of web design, you can create links to other pages in one of two ways: use absolute path URLs, or...
Read more >
Relative and absolute paths, in the file system and on ...
The simplest example of relative path is just a file name, like index.html . So one should be careful with relative paths. If...
Read more >
Simple trick to work with relative paths in Python
1. Absolute path ... The most straight-forward method is just using an absolute path in our code. ... While this works perfectly on...
Read more >
How do you use relative paths in ColdFusion?
Solved: I'm having a problem I cant wrap my head around. I have 4 websites that all reside under C:\ColdFusion9\wwwroot\websites\.
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