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

$client->request('GET', $nonExistantUrl) returns status 200 #67

Open
ChangePlaces opened this Issue Jul 25, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@ChangePlaces
Copy link
Contributor

ChangePlaces commented Jul 25, 2018

I've just spent the last few hours trying to figure out why a url that should be 404'ing is returning 200. I assumed it was a problem with the cache, but after dd'ing the response, clearly it isn't. The response contains the normal 404 response text from symfony, but with a 200 status.

reproduce: use a panther client to make a request to a non-existing url, and see the status is 200, instead of 404.

@ChangePlaces

This comment has been minimized.

Copy link
Contributor

ChangePlaces commented Jul 25, 2018

SeleniumHQ/selenium-google-code-issue-archive#141

This, unbelievably is impossible. I can not believe it. There are some 'workarounds' listed in this so post but, still, shocking.

@ChangePlaces

This comment has been minimized.

Copy link
Contributor

ChangePlaces commented Jul 26, 2018

After more research it will never be fixed because selenium mission statement is to reflect what the user will see, and they never see status codes.

This means that returning a status code is wrong. I understand it's necessary to be backwards compatible with web browser / gouette. However, returning a defacto 200 status code is inappropriate. Personally I'm not happy with trying to force Panther to have the same interface as the others - although they do a similar job, they have different use cases, so I see there are two solutions:

  1. Break Panther out and away from the interface, and not return a status code in the Response object,
  2. Use a more appropriate http code rather than the hardcoded 200, so developers aren't testing for 200's and thinking everything is ok when it isn't and force them to understand that testing for response codes with panther is inappropriate. I can't see a suitable http code from this list, but maybe one should be chosen (or informally created) and documented
@dunglas

This comment has been minimized.

Copy link
Member

dunglas commented Sep 13, 2018

In the meantime, se should at least add a note about that in the docs.

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