Code Monkey home page Code Monkey logo

Comments (4)

amotl avatar amotl commented on June 11, 2024

By analyzing the output on CI, it looks like the endpoint is responding with 200 OK, but yields an empty response body. Maybe it should respond with 204 No Content instead? See #44.

from grafana-client.

amotl avatar amotl commented on June 11, 2024

I've been able to reproduce the regression, and confirm the observation referenced above.

it looks like the endpoint is responding with 200 OK, but yields an empty response body.

This makes JSON parsers croak.

Grafana 9.2.7

docker run --rm -it --publish=3000:3000 --env='GF_SECURITY_ADMIN_PASSWORD=admin' grafana/grafana:9.2.7
HTTP folder create/delete conversation on Grafana 9.2
sink:grafana-wtf amo$ http --auth=admin:admin POST localhost:3000/api/folders title=foobar
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 278
Content-Type: application/json
Date: Wed, 30 Nov 2022 11:33:30 GMT
Expires: -1
Pragma: no-cache
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Xss-Protection: 1; mode=block

{
    "canAdmin": true,
    "canDelete": true,
    "canEdit": true,
    "canSave": true,
    "created": "2022-11-30T11:33:30Z",
    "createdBy": "admin",
    "hasAcl": false,
    "id": 1,
    "title": "foobar",
    "uid": "pyENC4KVz",
    "updated": "2022-11-30T11:33:30Z",
    "updatedBy": "admin",
    "url": "/dashboards/f/pyENC4KVz/foobar",
    "version": 1
}


sink:grafana-wtf amo$ http --auth=admin:admin DELETE localhost:3000/api/folders/pyENC4KVz
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 59
Content-Type: application/json
Date: Wed, 30 Nov 2022 11:33:57 GMT
Expires: -1
Pragma: no-cache
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Xss-Protection: 1; mode=block

{
    "id": 1,
    "message": "Folder foobar deleted",
    "title": "foobar"
}

Grafana 9.3.0

docker run --rm -it --publish=3000:3000 --env='GF_SECURITY_ADMIN_PASSWORD=admin' grafana/grafana:9.3.0
HTTP folder create/delete conversation on Grafana 9.3.0
sink:grafana-wtf amo$ http --auth=admin:admin POST localhost:3000/api/folders title=foobar
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 313
Content-Type: application/json
Date: Wed, 30 Nov 2022 11:34:16 GMT
Expires: -1
Pragma: no-cache
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Xss-Protection: 1; mode=block

{
    "canAdmin": true,
    "canDelete": true,
    "canEdit": true,
    "canSave": true,
    "created": "2022-11-30T11:34:16.024847779Z",
    "createdBy": "admin",
    "hasAcl": false,
    "id": 1,
    "parentUid": "",
    "title": "foobar",
    "uid": "8EmOC4K4z",
    "updated": "2022-11-30T11:34:16.024847824Z",
    "updatedBy": "admin",
    "url": "/dashboards/f/8EmOC4K4z/foobar",
    "version": 1
}


sink:grafana-wtf amo$ http --auth=admin:admin DELETE localhost:3000/api/folders/8EmOC4K4z
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 0
Content-Type: application/json
Date: Wed, 30 Nov 2022 11:34:24 GMT
Expires: -1
Pragma: no-cache
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Xss-Protection: 1; mode=block


from grafana-client.

amotl avatar amotl commented on June 11, 2024

I've reported the observations at grafana/grafana#59546.

from grafana-client.

amotl avatar amotl commented on June 11, 2024

On a recent version of Grafana, there is a non-empty response again now.

$ http --auth=admin:admin DELETE localhost:3000/api/folders/8EmOC4K4z
HTTP/1.1 404 Not Found
Cache-Control: no-store
Content-Length: 51
Content-Type: application/json
Date: Fri, 29 Mar 2024 10:40:34 GMT
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Xss-Protection: 1; mode=block

{
    "message": "folder not found",
    "status": "not-found"
}

from grafana-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.