Skip to content

forwarded property missing in /history/database API response #2735

@vermacodes

Description

@vermacodes

Versions

  • Pi-hole: v6.3
  • Web: v6.4
  • FTL: v6.4.1

Platform

  • OS and version: Alpine Linux (Pi-hole Docker image)
  • Platform: Docker (docker-compose)

Expected behavior

GET call to /history/database API endpoint should give number of calls 'forwarded' like in following example from api docs.

{
  "history": [
    {
      "timestamp": 1511819900.539157,
      "total": 2134,
      "cached": 525,
      "blocked": 413,
      "forwarded": 1196
    },
    {
      "timestamp": 1511820500.583821,
      "total": 2014,
      "cached": 52,
      "blocked": 43,
      "forwarded": 1910
    }
  ],
  "took": 0.003
}

Actual behavior / bug

'Forwarded' metric is not part of the response object.

{
  "history": [
    {
      "timestamp": 1765314000,
      "total": 288,
      "cached": 204,
      "blocked": 61
    },
    {
      "timestamp": 1765314600,
      "total": 48,
      "cached": 33,
      "blocked": 12
    }
  ],
  "took": 0.0009014606475830078
}

Steps to reproduce

  1. Open https://pi.hole/api/docs/#get-/history/database (Replace the hostname as per your setup)
  2. Authenticate and update API Server Variables.
  3. Open GET /history/database
  4. Add from and until query parameters.
  5. Hit 'Try' button
  6. Observe that the response doesn't contain forwarded property.

You can copy the CURL command with SID and try that as well.

Expected fix:
The API response should honor the schema and include the forwarded property.

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions