JoeDog / siege

Siege is an http load tester and benchmarking utility
GNU General Public License v3.0
5.91k stars 386 forks source link

Disabling HTTP content-type guessing #105

Open chorsley opened 7 years ago

chorsley commented 7 years ago

I'm trying to send an XML file to an application which requires a content-type of 'application/xml'. This doesn't appear to be in the mapping at https://github.com/JoeDog/siege/blob/master/src/load.c#L46.

I'm sending like this from my urls.cfg:

https://localhost:8080/services/inbox POST < /tmp/testdata/somexml.xml

When I specify the content type via either --header 'Content-type: application/xml' or --content-type 'application/xml', it ends up setting the application/xml header in addition to the auto-set text/xml header:

host:                  localhost:8080
Accept:                */*
Accept-Encoding:       gzip;deflate
User-Agent:            Mozilla/5.0 (apple-x86_64-darwin15.6.0) Siege/4.0.2
Content-type:          application/xml
Accept:                application/xml
Connection:            close
Content-type:          text/xml
Content-length:        6289

In this case, the application picks up the text/xml header and rejects it.

Is there any way to disable content-type guessing based on file extension entirely, and set it manually?