Skip to content
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

Query string parameters are only added if the URL contains a '?' #95

Open
markbirbeck opened this issue Aug 10, 2018 · 2 comments
Open

Comments

@markbirbeck
Copy link

markbirbeck commented Aug 10, 2018

For some reason if an options object like this is submitted:

{
  "method":"POST",
  "path":"/v1.37/containers/...blah.../attach",
  "options":{
    "_body":{},
    "_query":{
      "logs":"true",
      "stream":"true",
      "stdin":"false",
      "stdout":"true",
      "stderr":"true"
    }
  },
  "statusCodes":{"101":true,"200":true,"400":true,"404":true,"500":true},
  "isStream":true
}

the parameters in _query are not added to the URL. However, if there is a question mark in the URL (in path), they are added:

{
  "method":"POST",
  "path":"/v1.37/containers/...blah.../attach?",
  "options":{
    "_body":{},
    "_query":{
      "logs":"true",
      "stream":"true",
      "stdin":"false",
      "stdout":"true",
      "stderr":"true"
    }
  },
  "statusCodes":{"101":true,"200":true,"400":true,"404":true,"500":true},
  "isStream":true
}

The line that causes this is modem.js#L115, but I'm wary of touching it since I'm not quite sure what the logic was.

@apocas
Copy link
Owner

apocas commented Sep 23, 2019

This comes from way back.
At the time the Docker API was very young. There were endpoints sending/posting data in very different ways and different signatures everywhere.
Question mark was used in order to easily identify which ones used query string :)

@lyleunderwood
Copy link

Spent a bunch of time tracking this down today. Is this still relevant to the docker API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants