Skip to content
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

Aliyun::OSS::ServerError: You must provide the Content-Length HTTP header. #73

Open
lazybios opened this issue Sep 17, 2021 · 0 comments

Comments

@lazybios
Copy link

正常表单上传,有时候会报Aliyun::OSS::ServerError,一段时间基本上是必现,提示缺少Content-Length参数,不过发现通过direct upload方式上传是不会报错的。

表单参数

=> #<ActionController::Parameters {"_method"=>"put", "authenticity_token"=>"xxxxxxx", "user"=>#<ActionController::Parameters {"avatar"=>#<ActionDispatch::Http::UploadedFile:0x00007fc34934b728 @tempfile=#<Tempfile:/var/folders/s9/g41qq3bs7dv10n9lt7z4st5r0000gn/T/RackMultipart20210917-28937-o36uet.jpeg>, @original_filename="71670020_415058982543577_8058120922903287954_n.jpeg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"user[avatar]\"; filename=\"71670020_415058982543577_8058120922903287954_n.jpeg\"\r\nContent-Type: image/jpeg\r\n">, "type"=>"local"} permitted: false>, "controller"=>"users", "action"=>"profile", "format"=>"2"} permitted: false>

报错信息

Aliyun::OSS::ServerError: You must provide the Content-Length HTTP header. RequestId: xxxxxxxxxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant