Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

/info api returns with unicode back spaces #1237

Closed
u2mejc opened this issue Sep 24, 2015 · 2 comments
Closed

/info api returns with unicode back spaces #1237

u2mejc opened this issue Sep 24, 2015 · 2 comments

Comments

@u2mejc
Copy link

u2mejc commented Sep 24, 2015

When calling the api request for /info, unicode \b chars in ascii are sent.

Background, built today:

$ docker version
Client:
 Version:      1.9.0-dev
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   743dc1c
 Built:        Mon Sep 21 13:20:09 UTC 2015
 OS/Arch:      linux/amd64

Server:
 Version:      swarm/0.5.0-dev
 API version:  1.16
 Go version:   go1.5.1
 Git commit:   HEAD
 Built:        
 OS/Arch:      linux/amd64

$ docker info
Containers: 38
Images: 4
Role: primary
Strategy: spread
Filters: affinity, health, constraint, port, dependency
Nodes: 1
 ip-192-168-100-206: 192.168.100.206:2375
  └ Containers: 38
  └ Reserved CPUs: 0 / 1
  └ Reserved Memory: 0 B / 2.051 GiB
  └ Labels: executiondriver=native-0.2, kernelversion=3.13.0-62-generic, operatingsystem=Ubuntu 14.04.2 LTS, storagedriver=aufs
CPUs: 1
Total Memory: 2.051 GiB
Name: go-devil-flathead

When I use curl, I'm getting a malformed string back: (including unicode backspaces "\u0008")

$ curl -v localhost:2375/v1.20/info
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 2375 (£0)
> GET /v1.20/info HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:2375
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Thu, 24 Sep 2015 21:26:32 GMT
< Content-Length: 945
< 
{"ID":"","Containers":38,"Driver":"","DriverStatus":[["\u0008Role","primary"],["\u0008Strategy","spread"],["\u0008Filters","affinity, health, constraint, port, dependency"],["\u0008Nodes","1"],["ip-192-168-100-206","192.168.100.206:2375"],[" └ Containers","38"],[" └ Reserved CPUs","0 / 1"],[" └ Reserved Memory","0 B / 2.051 GiB"],[" └ Labels","executiondriver=native-0.2, kernelversion=3.13.0-62-generic, operatingsystem=Ubuntu 14.04.2 LTS, storagedriver=aufs"]],"ExecutionDriver":"","Images":4,"KernelVersion":"","OperatingSystem":"","NCPU":1,"MemTotal":2202568704,"Name":"ip-192-168-100-251","Labels":null,"Debug":false,"NFd":0,"NGoroutines":0,"SystemTime":"2015-09-24T21:26:32.185780176Z","NEventsListener":0,"InitPath":"","InitSha1":"","IndexServerAddress":"","MemoryLimit":true,"SwapLimit":true,"IPv4Forwarding":true,"BridgeNfIptables":true,"BridgeNfIp6tables":true,"DockerRootDir":"","HttpProxy":"","HttpsProxy":"","NoProxy":""}

The string [to me] looks like copypasta from something and I created a PR to remove these characters that does not impact the cli. This is chipping away at the larger issue that this API call is simply calling the cli functions instead of the cli and api having a shared generic function (discussed here: #1214).

@vieux
Copy link
Contributor

vieux commented Sep 24, 2015

Hello @u2mejc, see my answer in #1147

@abronan
Copy link
Contributor

abronan commented Dec 17, 2015

Closing as a duplicate of #1214.

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

No branches or pull requests

3 participants