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

Duplicate Content-Type headers on POST request #2

Closed
cujanovic opened this Issue Sep 26, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@cujanovic

cujanovic commented Sep 26, 2017

Hi,
I assume that due to: https://github.com/insp3ctre/race-the-web/blob/master/racer.go#L324

when sending a POST request to some app with Content-Type:application/json header in the toml file, the app receives duplicate Content-Type headers which results with Error 400 Bad Request responses on some apps.

Can this be improved maybe by checking if Content-Type:application/json header is already set and then don't add automatically the Content-Type: application/x-www-form-urlencoded one?

Btw, thanks for making this practical tool!

@MrVaughan

This comment has been minimized.

MrVaughan commented Sep 26, 2017

I literally saw the same issue just this minute also.

If the content type were provided as a header in the config file can that override the one set by the application?

@insp3ctre

This comment has been minimized.

Owner

insp3ctre commented Sep 28, 2017

Thanks for pointing this out. I can look into writing this in. I'll likely do what @MrVaughan suggested and add in a section for content-type header, defaulting to application/x-www-form-urlencoded one.

Cheers,
Aaron (insp3ctre)

@insp3ctre insp3ctre closed this in f59ef88 Oct 2, 2017

@insp3ctre

This comment has been minimized.

Owner

insp3ctre commented Oct 2, 2017

All set. I just did a check for the "Content-Type" header passed in via the config, then added it if it was not already present. Otherwise, it leaves it alone. Thanks for posting this bug!

Cheers,
Aaron (insp3ctre)

@insp3ctre

This comment has been minimized.

Owner

insp3ctre commented Oct 3, 2017

Binaries have been added for release 2.0.1, which fixed this issue.

Cheers,
Aaron (insp3ctre)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment