Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

GET render with content-type header results in an error #1465

Closed
Dieterbe opened this issue Sep 18, 2019 · 0 comments · Fixed by #1466
Closed

GET render with content-type header results in an error #1465

Dieterbe opened this issue Sep 18, 2019 · 0 comments · Fixed by #1466

Comments

@Dieterbe
Copy link
Contributor

Dieterbe commented Sep 18, 2019

This is easily verified using docker-dev.

A content-type header on a GET request which has no body isn't useful, but the http RFC seems to allow it. Graphite allows it too, so we should allow it too.
(without the header specified, it works fine)

graphite

http  'http://localhost:8080/render?target=stats.docker-env.response.200&from=-6s&format=json' 'Content-Type:application/json'
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, must-revalidate, max-age=0
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 137
Content-Type: application/json
Date: Wed, 18 Sep 2019 14:28:01 GMT
Expires: Wed, 18 Sep 2019 14:28:01 GMT
Keep-Alive: timeout=5, max=100
Server: Apache/2.4.18 (Ubuntu)
Vary: Accept-Encoding
X-Graphite-Hostname: graphite
X-Graphite-Timing: D=91222 t=1568816881642327

[
    {
        "datapoints": [
            [
                null,
                1568816876
            ],
            [
                1.0,
                1568816877
            ],
            [
                null,
                1568816878
            ],
            [
                null,
                1568816879
            ],
            [
                null,
                1568816880
            ],
            [
                null,
                1568816881
            ]
        ],
        "tags": {
            "name": "stats.docker-env.response.200"
        },
        "target": "stats.docker-env.response.200"
    }
]

metrictank

http  'http://localhost:6060/render?target=stats.docker-env.response.200&from=-6s' 'Content-Type:application/json'
HTTP/1.1 422 Unprocessable Entity
Content-Encoding: gzip
Content-Length: 96
Content-Type: application/json; charset=utf-8
Date: Wed, 18 Sep 2019 14:29:00 GMT
Vary: Accept-Encoding

[
    {
        "classification": "RequiredError",
        "fieldNames": [
            "target"
        ],
        "message": "Required"
    }
]

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