Comments (10)
Cheers,
Will have a look
Delivered to you from my iDevice
On Mar 28, 2013, at 4:16 PM, ashishsharma09 [email protected] wrote:
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.
—
Reply to this email directly or view it on GitHub.
from stubby4j.
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:
attributes: '["id","uuid","created","lastUpdated","displayName","email","givenName","familyName"]'. So my config.yaml looks like:
- 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.
from stubby4j.
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:
attributes: ["id"]
- fails with 404.
attributes: '["id"]'
- fails from browser and any other http client api. Works with StubbyClient only.
attributes: '[%22id%22]'
- makes browser and everyone else happy.
I would expect it to work with ["id"]
as this is more sensible and readable. If you get a chance please give it a go and let me know what you think.
FYI - I tried file: as well in the request but that did not help either.
Thanks,
Ashish
from stubby4j.
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.
from stubby4j.
I am looking into this... Stay tuned
from stubby4j.
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:
http://localhost:8882/entity.find?type_name=user&client_id=id&client_secret=secret&attributes=["id","uuid","created","lastUpdated","displayName","email","givenName","familyName"]
and
http://localhost:8882/entity.find.again?type_name=user&client_id=id&client_secret=secret&attributes=[id,uuid,created,lastUpdated,displayName,email,givenName,familyName]
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
from stubby4j.
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 %22
in you YAML
from stubby4j.
I am closing the ticket for now, but please report if the problem is still persists.
from stubby4j.
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,
Ashish
from stubby4j.
Hi Ashish,
Just in case, I am also supporting for:
http://localhost:8882/entity.find.single.quote?type_name=user&client_id=id&client_secret=secret&attributes=['id','uuid','created']
where array elements are enclosed with single quotes
Just get the latest version of stubby
from stubby4j.
Related Issues (20)
- Issue with Spring Boot 2.3.4 - Upgrade to Snake YAML 1.26 HOT 3
- ANNOUNCEMENT: BREAKING CHANGES FROM v7.0.0
- Split yaml config file HOT 12
- How to disable the RegEx pattern cache? HOT 16
- How to match "a token not in the payload" with RegEx pattern? HOT 7
- [FEATURE REQUEST] Request proxying HOT 7
- [FEATURE REQUEST] Create a client to simplify configuration through HTTP HOT 3
- [NEW FEATURE RELEASED]: Request Proxying is GA
- [DOCKER HUB]: stubby4j multi architecture Docker images are on DockerHub HOT 3
- [NEW FEATURE RELEASED]: Added support for HTTP/2 over TLS
- [QUESTION] Regex with XML in request.file and response.file HOT 20
- [NEW FEATURE RELEASED]: Added support for WebSocket [RFC6455] over HTTP/1.1 and HTTP/1.1 with TLS
- [SECURITY] Upgrade log4j to 2.16.0 as a vulnerability workaround HOT 3
- [SECURITY] Upgrade log4j to 2.17.0 as a vulnerability workaround HOT 3
- [SECURITY] Upgrade log4j to 2.17.1 as a vulnerability workaround HOT 3
- [ENHANCEMENT] Moving the baseline to JDK 11 and moving to Jetty 11 HOT 2
- [FEATURE REQUEST] We want to have a way to get a count on requests made to stub uri and reset the count for next test to run HOT 5
- for websocket on-message's client request from the text file new line (Enter) not accepted by using of stubby4j any solution or guideline to use new line in requested file, my requirement is, in requested text file must use multiline value HOT 9
- [FEATURE REQUEST] ... Support ARM Docker Images HOT 14
- [QUESTION] Is it possible to configure websocket server to return different results HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stubby4j.