This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
Add support for multipart/form-data conversions #22
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Upload-based conversions can now be carried out by calling a POST request on `/convert` using the `file` parameter. Example: curl -F file=@index.html localhost:8080/convert The output is a binary stream (much like the GET endpoint). This change significantly refactors the way a conversion target / source is handled. When running a conversion, we now provide an explicit conversion source. Before, we relied on an implicit source (that we simply assumed a Converter will handle). The conversion source also contains the MIME type of our conversion target. We can extend this to handle a range of different conversions in the future. The old `util` package, and its methods have been integrated into `source.go`. All URLs are checked w/ cookie support. A new CloudConvert method was also introduced for quick upload-based conversions. In the future, it might be worth using the `inline` download method only, and rely on our own S3 uploader (that way, we won't be passing our S3 credentials around). TODO: refactor middleware, and application-wide config.
cc: @arachnys/qa |
The tests isolated a problem in content type detection. The read / write pointer was not reset to 0 after creating the temporary file.
MrSaints
force-pushed
the
add-multipart-support
branch
from
April 26, 2016 18:53
61c037c
to
97eb647
Compare
Also, set `attempts` back to 0. It was mistakenly set to 1 during testing.
@MrSaints an example of an Ethiopian page which Athena seems to have trouble handling - nothing to do with this PR in particular, but I thought you'd be interested! |
@cedric-cordenier That's a good catch. I'll bear that in mind. |
Merged. IMPORTANT:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upload-based conversions can now be carried out by
calling a POST request on
/convert
using thefile
parameter.
Example:
The output is a binary stream (much like the GET
endpoint).
This change significantly refactors the way a conversion
target / source is handled. When running a conversion,
we now provide an explicit conversion source. Before, we
relied on an implicit source (that we simply assumed a
Converter will handle).
The conversion source also contains the MIME type of
our conversion target. We can extend this to handle a
range of different conversions in the future.
The old
util
package, and its methods have beenintegrated into
source.go
. All URLs are checked w/cookie support.
A new CloudConvert method was also introduced for quick
upload-based conversions. In the future, it might be
worth using the
inline
download method only, and relyon our own S3 uploader (that way, we won't be passing
our S3 credentials around).
TODO: refactor middleware, and application-wide config.