-
Notifications
You must be signed in to change notification settings - Fork 13
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
Change upload to use 2 requests or http 100 code #183
Comments
We can also use http 100 code where header is sent first and then body of request later within the same request.
|
Here we also can simplify the signing of uploaded file, we can join upload request with sign request: |
question: is md5 is reliable for this, or it's better to use sha1/256 checksum? |
yeah, we can use sha256 |
After implementing this method, how clients of gorjun will upload to gorjun? I am wondering about clients of gorjun. How will you implement client side? |
To make NGINX support Expect:100-Continue header we need to add these directives to NGINX conf:
From client side we need to send header |
Go http client supports |
Currently we are having issues with upload of files to our CDN:
To solve these issues we can change the logic in the following way:
Client makes initial request to server that contains the following:
Header/Form parameters:
token kurjun token
md5sum of file to be uploaded
size of file to be uploaded
Server performs check of token and user quota (using the received size)
a) in case checks don't pass, server returns appropriate 4xx code to let client fail early
b) otherwise, server returns http 200 code with a new special one-time upload token which is stored on server side along with md5sum of file to be uploaded. This token has TTL of 24 hours
Client receives the one time upload token and sends the file along with the upload token back to server
or fails early if 4xx code is returned from the server
Server receives the file, checks the md5sum of it along with the upload token (its ttl too), stores the file and removes the token. In case checks don't pass, the file is discarded and 4xx code is returned
Client completes the operation with a proper result interpretation to user
The text was updated successfully, but these errors were encountered: