-
Notifications
You must be signed in to change notification settings - Fork 103
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
StubbyClient works but no other HttpClient or Browser #13
Comments
Cheers, Delivered to you from my iDevice On Mar 28, 2013, at 4:16 PM, ashishsharma09 notifications@github.com wrote:
|
I eventually found out it's the query string that is causing the problem, not sure though why that is working with stubbyClient but not with apache HttpClient or browser. The query string parameter that is causing the problem is as follows: - request:
method: GET
url: /entity.find
query:
type_name: user
client_id: id
client_secret: secret
attributes: '["id","uuid","created","lastUpdated","displayName","email","givenName","familyName"]'
response:
status: 200
file: entity-find-response.json
headers:
content-type: application/json If I remove the "attributes" parameter above it works all right. But with it I get 404 on accessing from browser or apache HttpGet. Please note single quotes around the value for "attributes". If I remove it, stubbyClient starts returning 404 as well. |
Hi, Has anyone had a chance to look into it yet? I think I have found what was causing the problem. It's the double quotes in the query parameter which causes the problem (took me good two days with lots of trial and error to figure it out). I was initially wrongly assuming it's the '[]' brackets. So following is my finding:
I would expect it to work with FYI - I tried file: as well in the request but that did not help either. Thanks, |
It looks as if query-string parameters are not being URI-encoded while loading them into the system (or at least not at all entry points). Sorry for the lack of "official" responses. We've been tied down at work lately. Flagging this as a bug. Also edited a couple of the comments here to make the code portions more readable. |
I am looking into this... Stay tuned |
Ok... I have put a fix in place for the scenario when query string contains array with elements within as per your example. I have tested both for: Works both when making request programmatically via StubbyClient and browser. The bug will be resolved in v1.0.59. Will push it to Maven Central shortly |
You can continue using your original configuration: - request:
method: GET
url: /entity.find
query:
type_name: user
client_id: id
client_secret: secret
attributes: '["id","uuid","created","lastUpdated","displayName","email","givenName","familyName"]'
response:
status: 200
file: entity-find-response.json
headers:
content-type: application/json In other words, no need to replace double quotes with |
I am closing the ticket for now, but please report if the problem is still persists. |
Hi, Thanks for putting the fix in place so quickly. I will pick up the new version and try as soon as possible. Can't wait to see my yaml look pretty again. Will keep you posted... Thanks, |
Hi Ashish, Just in case, I am also supporting for: Just get the latest version of stubby |
With stubbyClient.startJetty only stubbyClient.doGet works. When I try to access the configured URL from Browser or using apache HttpClient or HttpConnection, the response is 404. Why the jetty server started through stubbyClient not visible to other APIs.
The text was updated successfully, but these errors were encountered: