Skip to content

Response's body is percent encoded when parametrized queries #96

Open
@Nayte91

Description

@Nayte91

Hello,

When I fetch a resource with a "fields" query parameter, the received fields are percent encoded. But when I vanilla fetch or header-based-fields fetch, the resource's fields are "normal".

Front
scenario A
What I code:

const eventResp = await fetch("https://localhost:8000/events/2?fields=\"\/subtitle\",\"name\"")
console.log(await eventResp.json())

What it outputs:

Object { subtitle: "Internationaux%20de%20France%20de%20tennis%202019", name: "Roland%20Garros%202019" }

ScenarioB
What I code:

const eventResp = await fetch("https://localhost:8000/events/2")
console.log(await eventResp.json())

What it outputs:

Object { "@context": "/contexts/Event", "@id": "/events/2", "@type": "https://schema.org/Event", id: 2, name: "Roland Garros 2019", subtitle: "Internationaux de France de tennis 2019", heading: "120ème édition des Internationaux de France de tennis sont le plus grand tournoi de la saison de tennis sur terre battue.", startDate: "2019-05-26T00:00:00+00:00", endDate: "2019-06-09T00:00:00+00:00", visibility: "public", … }

Back
PHP 6.1 / APIP 3.0.3, served by Caddy 2.7.4 / http.handlers.vulcain v0.5.0

localhost:8000

log

route {
    root * /app/public
    vulcain
    push
    php_fastcgi backend:9000
    encode zstd gzip
    file_server
}

Another proof/test with Postman (see screenshot here)

  1. Is it intended?
  2. What can I do to avoid this behavior?
  3. Do you need more information from my context?

Thank you!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions