newsapps/beeswithmachineguns

how to handle headers with colons in the value ?

Opened this issue · 3 comments

How do I pass a header that has colons in the value? Or what modifications would be needed to the code to allow this? Thanks.

bees attack -u http://no.where.com/ -H 'Authorization: Gigya uid:acKCkHLn6ReLDECVscSkYCVa64, timestamp:1474610145, signature:ldFpy4vEdWceNMbbyXDWpAnB0=, realm:09834000GUREWAP' -j -o -a 4
yathi commented

You need to separate each key-value pair under the header with a semicolon, like -H "Authorization: Gigya ; uid:acKCkHLn6ReLDECVscSkYCVa64 ; timestamp:1474610145"

Also I believe -H "<params>" is the last part of params. But most probably the order doesn't matter.

There are two gotchas with ":" and ";" parsing. First, if you don't quote the whole -H string, the ';' are treated as bash command splits. Second, either ":" or ";" could be part of the signature. For example, in AWS signature signing, the signature is composed of multiple parts separated by ";".

I'd recommend a more robust parsing mechanism.
For example, ab behaves like curl allowing multiple -H entries.

  • _
  • _كلام جميل