tomdesair / tus-java-server

Library to receive tus v1.0.0 file uploads in a Java server environment
MIT License
128 stars 60 forks source link

Dynamic upload path #11

Closed nschwalbe closed 6 years ago

nschwalbe commented 6 years ago

Expected Behaviour

It would be nice if the uploadURI can contain some path variables because I need some extra information to the file upload and it fits better to my REST URIs than putting it into the Upload-Metadata. E.g. /users/{userId}/files/upload

Actual Behaviour

POST /users/123/files/upload returns 405 with message: POST requests have to be send to /users/{userId}/files/upload

tomdesair commented 6 years ago

Hi @nschwalbe,

That's indeed a valid use case. What do you think about adding regex support for the upload URI String? Then you would be able to do something like:

tusFileUploadService.withUploadURI("/users/[0-9]+/files/upload")

A POST request will then validate if the given request URI matches the specified upload URI pattern.

nschwalbe commented 6 years ago

Hi Tom, thanks for implementing this feature so fast. It works great and seems a good solution. I'm looking forward to the next release ;)

Best regards, Nathanael

tomdesair commented 6 years ago

Hi @nschwalbe,

I've released this change as version 1.0.0-1.2: https://github.com/tomdesair/tus-java-server/releases/tag/1.0.0-1.2

If this solves your problem, feel free to close this issue.

Best regards, Tom

nschwalbe commented 6 years ago

Perfect, thanks!