Codeception: On POST creation, 201 status with a Location header should not fail

Created on 4 Jun 2016  路  3Comments  路  Source: Codeception/Codeception

In the case of a POST interaction, InnerBrowser is aggressively evaluating a redirection response header, and evaluating a response as a failure if the browser is not redirected.

In this particular case, a _Location_ header doesn't indicate a redirection, but instead indicates the location of the created record (defined in boring detail in RFC2616, 10.2.2).

Would there be other issues I'm not seeing by also checking for an HTTP status code of 201 and not interpreting the Location header as a redirect? Even better than that, check for no status code or a 3xx code and then evaluate the purpose of the header?

As a side note, 2.2.1 sees the issue, but 2.1.10 does not.

Most helpful comment

Thanks. Probably I encountered this as well. We will try to fix it today

All 3 comments

Thanks. Probably I encountered this as well. We will try to fix it today

Thanks @DavertMik and @Naktibalda! Really enjoying the framework - it's a phenomenal improvement for us consolidating testing.

Will also merge into 2.2

Was this page helpful?
0 / 5 - 0 ratings