Skip to content

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

@eldarj

Description

@eldarj

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions