Skip to content
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

Java TUS Server returns Location without url hostname, which breaks flutter #37

Open
eldarj opened this issue Dec 16, 2020 · 0 comments

Comments

@eldarj
Copy link

eldarj commented Dec 16, 2020

As the title says, I've implemented the Java TUS Server sample, which upon uploading a file, returns a Location without the full-url, but just the endpoint, e.g. /api/uploads/random-file-upload-id

I just started looking into TUS, and not sure whether this is an issue on the server side or this flutter client but the client breaks with an exception saying that the Location arg. i.e. resource URL doesn't contain the hostname/base.

I've inspected the client, and fixed this with prepending the Location url with the server hostname, but as said, I'm not sure whether this is an issue on the server or client side impl.

Is there a way to set up the server to provide the full url for the resource?

My flutter dependencies:

  http: ^0.12.2
  tus_client: ^0.0.4

TUS Server dep:

        <dependency>
            <groupId>me.desair.tus</groupId>
            <artifactId>tus-java-server</artifactId>
            <version>1.0.0-2.0</version>
        </dependency>

How I temporarily fixed this is with providing a custom e.g. X-Location header param with the full uploaded resource url (containing server hostname), whcih I then use on the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant