Skip to content

Use 'read' method to get request body in Conan

Steve Abrams requested to merge 246741-conan-unicorn-bug into master

What does this MR do?

When parsing the incoming request body on the two /upload_urls Conan endpoints, we currently use:

Gitlab::Json.parse(request.body.read)

However, when using Unicorn, this results in an error:

NoMethodError: undefined method `string' for #<Unicorn::TeeInput:0x00007f2ee811fad0>

This was identified previously as a bug in a separate API endpoint: #215391 (closed), so this fix follows the fix and tests that resolved that issue.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

Related #246741 (closed)

Edited by Steve Abrams

Merge request reports