Description
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)
- Is it intended?
- What can I do to avoid this behavior?
- Do you need more information from my context?
Thank you!
Activity