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
Wrong status code #789
Comments
Are there event listeners in your testing environment that could be causing this? Can you provide debug output (verbose curl output) so we can see what's actually sent over the wire? You can turn on debug output with the following: $client->setDefaultOption('debug', true); |
about the events I would say no, maybe @andrerom could help us here. So the output is:
|
The server returned a 200, so it looks like Guzzle is doing the right thing. Maybe there's an issue with the test itself?
|
looking at Guzzle request print_r It looks that the request is done as: and using cURL directly form cli as:
|
I think I missed what you're trying to show me. Can you tell me where you think guzzle is doing the wrong thing? It still looks like there's something else wrong based on the curl output that you got when using guzzle. I would bet if you created a one-off script to contact your test server that it would work without issue. If that's the case, then something else is wrong.
|
I'm not sure about it, but the request should be returning a
I've done a simple test with guzzle
And it returned:
However, again, it should return a 404 |
I still think something else is going on here. Guzzle is getting back a 200 response from your server, so I don't see a client-side issue here. |
Tbh, I don't know that deep to say where the problem is. However, the same request is working with Buzz client and also testing the same with Firefox RESTClient @bdunogier do you have any idea, if the REST server might/could behave differently depending on which client is being used? |
No, the server doesn't behave differently depending on the client. Not on purpose at least :-) Based on the output of your commands, the 404 is returned by the server, is it not ?
Or am I missing something ? As I see it, the server returns the correct value, and it is correctly interpreted by BuzzClient and other clients, right ? Or am I missing something, @mtdowling ? Maybe something with 404 and delete ? What happens if you run a GET on the same request with Guzzle, @mloureiro ? The server should reply with a 404, but is Guzzle interpreting it as such ? |
Same response. |
@bdunogier This is a strange issue. Guzzle isn't actually interpreting anything incorrectly, it's using what was returned from the server via cURL. Guzzle is doing the right thing at the HTTP level. If you look at all of the verbose cURL output provided by @mloureiro, you can see that guzzle actually gets back a 200 response from the server. I don't see a client-side issue here. This makes me think there's something going on server-side that's returning a 200 response when it shouldn't. Look at this verbose output:
Notice that the response has a content-type of |
Ok @mtdowling, asap I'll post here the body. |
Ok, actually as @mtdowling said it seems some problem on the server side The body of the response contains a noon caught exception:
|
@mloureiro Probably need to compare the request sent to the server here instead of the response, also make sure you update symfony as there has been some fixes regarding header parsing over the last maintenance releases. |
Is it ok to close this issue now, or do you still think there's a client-side problem? |
I'd say it's fine, right @mloureiro ? |
Yep... |
Might be the following bug: https://bugs.xdebug.org/view.php?id=587 |
I'm using Guzzle to test eZ Publish REST server, in which has a request:
That should return a
404
when not found, but (from the tested clients) only Guzzle returns a200
.Firefox RESTClient addon
Buzz
Guzzle 3 and Guzzle 4:
Guzzle4 request print_r
Guzzle4 response print_r
eZ Publish issue: https://jira.ez.no/browse/EZP-23285
The text was updated successfully, but these errors were encountered: