wooga / etest_http

etest Assertions around HTTP (client-side)
Other
52 stars 20 forks source link

perform_request follows redirects by default #2

Closed lpgauth closed 12 years ago

lpgauth commented 12 years ago

Hi, I've noticed that perform_request/5 always follows redirects. Is this a wanted behavior?

I added the HttpOptions {autoredirect, false} to be able to properly test 302s...

https://github.com/lpgauth/etest_http/commit/abf23d07e94182ed2c42e6f20d0434ee9b5a632d

from http://www.erlang.org/doc/man/httpc.html

autoredirect

Should the client automatically retrieve the information from the new URI and return that as the result     
instead of a 30X-result code.

Note that for some 30X-result codes automatic redirect is not allowed. In these cases the 30X-result 
will always be returned.

Defaults to true
complex64 commented 12 years ago

No it is not and I guess we have just not come across a case where we would test for redirects. At the moment etest_http is the bare minimum to make it work for us. It might get more attention when I have time to spare.

I just merged you commit, should you come across other deficiencies, please let me know :)