Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Proxy full URL for API requests preserving query string #346

Merged
merged 1 commit into from

4 participants

@dpowell

No description provided.

@stefanpenner stefanpenner merged commit a26b5a3 into from
@stefanpenner

good catch, thanks!

@ganicus

Out of pure curiosity, what would be the appropriate way to stub a query string request?

@stefanpenner
Owner

@ganicus thats a good question for señor @machty

@machty
Collaborator

I think @ganicus is referring to stubbing an ajax call with a query string, right? Not really sure the EAK way of doing this

@ganicus

Right! Suppose I had a query string like "/images?ids[]=72405&ids[]=72406&ids[]=72407".

I think I'd like to develop something that would stub a generic placeholder (disregarding the image ids) for each image. Is anyone anywhere of any similar design pattern for this? Maybe something used for testing or development?

EDIT: A little digging into express.js did wonders. I can get my query parameters simply by "req.query".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  tasks/express-server.js
View
2  tasks/express-server.js
@@ -106,7 +106,7 @@ module.exports = function(grunt) {
function passThrough(target) {
return function(req, res) {
- req.pipe(request(target+req.path)).pipe(res);
+ req.pipe(request(target+req.url)).pipe(res);
};
}
};
Something went wrong with that request. Please try again.