Commit Graph

49 Commits

Author SHA1 Message Date
Adam Jensen 5252c98cd7 Avoid incorrectly returning errors when upload length is deferred 2018-06-03 12:57:39 -04:00
Adam Jensen 64c02a9de1 Update the upload length in FileInfo when it's sent 2018-06-03 12:57:39 -04:00
Adam Jensen c94e0cd0b6 Add creation-defer-length to supported extensions 2018-06-03 12:57:39 -04:00
Adam Jensen 1ab5231643 Add basic Upload-Defer-Length header handling 2018-06-03 12:57:39 -04:00
Adam Jensen 1affbbdbe4 Add error constants for deferred upload length 2018-06-03 12:56:02 -04:00
Jason Papakostas 8acbc4cfdb Expose ParseMetadataHeader and SerializeMetadataHeader functions
closes #186
2018-05-22 11:52:22 -05:00
Marius c470fe3a9d Emit post-finish event for empty uploads
See https://github.com/tus/tus-js-client/issues/106
2018-03-29 14:40:43 +02:00
Marius dbd0a957b5 Allow plus sign in MIME types
For example, image/svg+xml
2018-03-03 21:56:46 +01:00
Marius 5e22d82ca5 Allow certain file types to be shown inline in browsers 2018-02-28 22:55:14 +01:00
Marius 6230c23566 Force browser to download content
For example, prevent HTML from being rendered
2018-02-19 18:28:42 +01:00
Marius a51f5994bb Squashed commit of the following:
commit d6ba86b7c300122af52e5be71b5fade4bb88d77c
Author: Marius <maerious@gmail.com>
Date:   Wed Jul 19 17:44:56 2017 +0200

    Add documentation for post-create

commit 1d1605f98036e6cfd7e2695cf2e4f8510a220326
Author: Marius <maerious@gmail.com>
Date:   Wed Jul 19 13:21:01 2017 +0200

    Remove duplicated log for created uploads

commit 1f5c6d22bb62e1251297db9b10f78f6db363759d
Author: Marius <maerious@gmail.com>
Date:   Wed Jul 19 13:08:11 2017 +0200

    Rename UploadsCreated to CreatedUploads to match other names

commit 5c67ea7548548986c4bce79b7eea311a02a4c541
Author: Marius <maerious@gmail.com>
Date:   Wed Jul 19 13:07:14 2017 +0200

    Remove unused variable from hook script

commit e21d7f5824ce533d80d74e75835ddc33de2184fb
Merge: 028ba57 447aa9c
Author: Marius <maerious@gmail.com>
Date:   Wed Jul 19 12:47:52 2017 +0200

    Merge branch 'f-post-create-hook' of https://github.com/flaneurtv/tusd into flaneurtv-f-post-create-hook

commit 447aa9c485
Author: Markus Kienast <mark@rickkiste.at>
Date:   Thu Jul 13 15:57:07 2017 +0200

    added post-create hook

    added test for handler.UploadCreated

    go fmt .
2017-07-19 17:45:16 +02:00
Matthew Wratt 5600cf2d6e Allow override of default options response 2017-04-12 11:53:15 +02:00
Marius c8b8703bb1 Move network timeout handling back in UnroutedHandler 2017-03-01 19:43:37 +01:00
oliverpool 74fca8c6c3 Squashed commit of the following:
commit d214ad5c92073cb754c70ab73e6cf229cba01c72
Author: Marius <maerious@gmail.com>
Date:   Tue Feb 28 20:38:47 2017 +0100

    Minor code and comment cleanups

commit 2826227404296d98a2d83519efaa754cc07a47b1
Merge: db47c89 1a58d6e
Author: Marius <maerious@gmail.com>
Date:   Tue Feb 28 20:13:15 2017 +0100

    Merge branch 'metrics_race_condition' of https://github.com/oliverpool/tusd into oliverpool-metrics_race_condition

commit 1a58d6e084
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Tue Feb 28 19:14:21 2017 +0100

    prometheus metrics typo

commit db47c8976489917a8afc53878335ab66d73fe60d
Merge: 168942b 12054be
Author: Marius <maerious@gmail.com>
Date:   Tue Feb 28 17:36:47 2017 +0100

    Merge branch 'metrics_race_condition' of https://github.com/oliverpool/tusd into oliverpool-metrics_race_condition

commit 12054be4e7
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Tue Feb 28 12:07:43 2017 +0100

    add go vet on travis

commit 16e95d2d91
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Tue Feb 28 11:58:58 2017 +0100

    add one go vet on appveyor

commit 13bc64517b
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Tue Feb 28 11:57:56 2017 +0100

    use even less pointers

commit db7130f18a
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Mon Feb 27 22:12:45 2017 +0100

    use pointer only when needed

commit 647f7390c6
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Thu Feb 23 16:29:01 2017 +0100

    Prevent lock malfunction

    literal copies lock value from metrics

commit 1ce196ed35
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Wed Feb 22 12:22:19 2017 +0100

    handle read timeout simplification in metrics

commit 338017c9f4
Merge: c378bc9 45a9278
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Wed Feb 22 12:21:42 2017 +0100

    Merge branch 'master' into metrics_race_condition

commit c378bc9798
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Wed Feb 22 11:51:56 2017 +0100

    consistent naming

commit e2b0050b8d
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Wed Feb 22 11:44:05 2017 +0100

    Use a simplfied error structure for error counting

commit 3da4095c08
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Mon Feb 20 16:38:27 2017 +0100

    split ptr retrieval and incrementation

commit ebd6873cbb
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Sun Feb 5 22:01:34 2017 +0100

    Useless initialization

commit 691224cdbf
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Thu Feb 2 08:25:55 2017 +0100

    increment the pointer

commit 3d9395e1df
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Thu Feb 2 08:25:42 2017 +0100

    Simplify lock logic

commit d7a4619080
Author: oliverpool <oliverpool@hotmail.fr>
Date:   Wed Feb 1 08:37:46 2017 +0100

    Prevent race condition on errorstotal increment

    The HTTPError interface is used to have detailed metrics (by code as
    well)
2017-02-28 20:40:44 +01:00
Marius 73b273d4bd Add documentation for NotifyUploadProgress 2017-02-21 23:17:07 +01:00
Marius ca95bf275a Exclude too detailed information from timeout error 2017-02-20 17:14:58 +01:00
Marius 7710fd79fb Correct parsing Upload-Concat for final uplaods
Addresses https://github.com/tus/tus-resumable-upload-protocol/issues/123
2017-01-31 16:58:31 +01:00
Marius f50f03fe6f Allow data store to set the status code for errors
Closes https://github.com/tus/tusd/issues/77
2017-01-26 23:15:05 +01:00
Marius 97bd6db73f Add NotifyUploadProgress configuration option 2017-01-19 21:02:58 +01:00
Marius 888049ce50 Add test for attempting empty download 2016-10-13 18:38:43 +02:00
Marius 182a96e3e8 Do not reject unexpected content types during upload creation
See tus/tus-java-client#10
2016-09-29 21:20:56 +02:00
Marius 9a5646ad6c Add proper, formatted logging 2016-09-23 21:21:38 +02:00
Marius dc673402d2 Add support for Creation With Upload extension
See tus/tus-resumable-upload-protocol#88 for the current proposal
2016-08-28 22:06:37 +02:00
Marius 6b1e8a8bda Respond with the correct 200 OK code for HEAD requests
Fixes #48
2016-08-28 15:26:12 +02:00
Marius c80c8b1962 Allow exposing metrics for Prometheus and Co. 2016-05-24 17:04:28 +02:00
Marius d6bc50ff12 Use 200 OK in responses for preflight requests
Some browsers only accept 200 OK and not 204 No Content as respones codes
for preflight requests.

See tus/tus-js-client#34
2016-05-10 11:58:43 +02:00
Marius 3e6ea68d07 Suggest original filename when downloading 2016-04-19 11:22:32 +02:00
Marius 4e8842d91c Do not pass chunk for uploaded uploads to data store 2016-04-09 22:09:22 +02:00
Marius bcea96b88e Add test for complete upload notifications using Concatenaiton 2016-03-12 22:52:31 +01:00
Marius acf2e8daee Improve documentation for complete uploads notifications 2016-03-12 22:28:24 +01:00
Marius 3ee1c61d80 Add post-terminate hook 2016-03-12 22:24:57 +01:00
Marius 03ab994a4e Merge branch 'master' into composer 2016-02-22 14:12:24 +01:00
Marius a949cb6b81 Set proper offset for complete notifications 2016-02-22 13:58:05 +01:00
Marius 21ae1c45a7 Add initial draft of StoreComposr 2016-02-21 23:25:35 +01:00
Marius 13c27e1c19 Send Upload Complete Notification for concatenations 2016-02-21 18:38:43 +01:00
Marius db9204927d Merge branch 'forwarded-host' 2016-01-23 14:11:47 +01:00
Marius b6a28421af Extract concatenation into own interface 2016-01-20 15:33:17 +01:00
Marius c9207d8c5f Extract GetReader into own interface 2016-01-19 22:32:15 +01:00
Marius 27d6ade187 Add RespectForwardedHeaders option to handlers
When activated, X-Forwarded-* and Forwarded headers will be checked for a
hostname and protocol used for generating absolute URLs.

Addresses #38
2016-01-16 15:27:35 +01:00
Marius b6d67debee Merge branch 'master' into s3
Conflicts:
	datastore.go
2015-12-27 00:48:06 +01:00
Marius 4af7434c10 Move terminating method in own interface
In addition, the DELETE handler is only provided if the TerminaterDataStore
interface is implemented.
2015-12-27 00:44:02 +01:00
Marius f6a5530df8 Integrate LockingStore into UnroutedHandler
The reason behind this drastic move was that sometimes a lock needs to
persist across multiple calls to a DataStore. For example, when a PATCH
request is received, following behaviour is wanted:
	* Obtain lock (LockUpload)
	* Get offset, size etc (GetInfo)
	* Write data (WriteChunk)
	* Release lock (UnlockUpload)
However, before this change, the lock would be release and then obtained again
after the GetInfo and before the WriteChunk call. This resulted in an
inefficient resource usage and even a possible race condition.

The effects of this change was:
* FileLocker is now directly integrated into FileStore and not sperarated
* LockingStore and the entire package has been removed
* MemoryLocker has been moved into its very own package
2015-12-26 21:23:09 +01:00
Marius 49d7c2ff78 Separate locking into data store implementation
The goal is to allow different locking mechanism to be used for different
storages. For example, in-memory for very few uploads, a file locker in
conjunction with the FileStore or an external service, such as ZooKeeper.
2015-12-09 20:25:08 +01:00
Marius ad5e486ba0 Merge master 2015-12-08 22:08:54 +01:00
Max Brosnahan e6f8969399 Handle failure to extract id from url 2015-12-08 09:37:34 +13:00
Max Brosnahan f27c9fd439 Remove dependency on pat for id extraction 2015-12-08 09:10:49 +13:00
Max Brosnahan 218cdfd022 Rename TusMiddleware function to Middleware 2015-12-08 09:10:02 +13:00
Max Brosnahan 12037a8e1d Tweak documentation 2015-12-08 09:09:47 +13:00
Max Brosnahan b36b5ac3bb Extract basic handlers into unrouted struct 2015-12-02 22:19:10 +00:00