superfly / edge

A set of useful libraries for Edge Apps. Run locally, write tests, and integrate it into your deployment process. Move fast and maybe don't break things? Because, gosh darnit, you're an adult.
https://fly.io
Apache License 2.0
143 stars 10 forks source link

queryString problem in `proxy` implementation #41

Open barnese3 opened 5 years ago

barnese3 commented 5 years ago

Query strings are being ignored in requests.

Example: requests like blah.com/path?stuff are getting sent to backends as just /path

Found with the following code while creating middleware/device-router:

if (deviceType === "mobile" && osName === "Android") {
  const backend = origin({
      origin: `https://play.google.com/store/apps/details?id=${options.android}`,
      headers: {host: "play.google.com"}
  });
  return backend(req);
}

origin is only being seen as https://play.google.com/store/apps/details rather than https://play.google.com/store/apps/details?id=${options.android}