Giter Club home page Giter Club logo

Comments (7)

bagder avatar bagder commented on June 1, 2024 1

Aha, ok. Thanks for clarifying.

from curl.

bagder avatar bagder commented on June 1, 2024

fails to sign properly when given Content-Type: multipart/form-data.

So why do you?

When sending a multipart formpost, the Content-Type header also needs a boundary string set (and curl needs to know it) and your provided header does not so curl is not able to produce a proper POST. You broke curl by providing a broken header.

update: curl actually can survive the situation and still do a formpost with a boundary so it does not exactly explain the error. Even though the original question why you would use this command line remains.

from curl.

Viphor avatar Viphor commented on June 1, 2024

So the same error occurs whether or not I give it the -H "Content-Type: multipart/form-data.
I left it there as this was how we received the bug internally.

from curl.

bagder avatar bagder commented on June 1, 2024

This confuses me. Your report says

When using the curl command with only a single file and without Content-Type: multipart/form-data everything works as expected

Isn't that quite the opposite of what you just said here?

from curl.

Viphor avatar Viphor commented on June 1, 2024

I think I might need to clarify then. :)
Whenever curl tries to send a request where curl uses the Content-Type: multipart/form-data, then it fails to sign correctly.
So in this case whether it automatically adds it because of -F or if I add it manually, then it fails to sign the message correctly.

Sorry for the confusion. :)

from curl.

bagder avatar bagder commented on June 1, 2024

I suspect this is because the generated Content-Type: type header used for multipart formposts is not taken into account correctly when the header hash is calculated.

from curl.

Viphor avatar Viphor commented on June 1, 2024

For context what we have done previously that worked was:

curl --verbose -X POST "${ENDPOINT}" \
-d "$DATA" \
--user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" \
--aws-sigv4 "aws:amz:${AWS_REGION}:${SERVICE}" \
--header "x-amz-security-token: $AWS_SESSION_TOKEN"

This has worked fine until we needed to upload multiple files.
Here we end up with Content-Type: application/x-www-form-urlencoded.

from curl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.