Skip to content

Some endpoints throw Internal Server Error when missing the trailing slash in the URL #1341

@jonbarrow

Description

@jonbarrow

Very likely related to #1286, almost identical symtoms just different responses and the trailing slash issue swapped the other way around. I'm unsure when this new error has started, since I took a break from working with the API, but it's possibly related to desophos/pokeapi-scala@59c6f55, since that touched the cache behavior? Unsure, I haven't dug into this at all besides checking with curl

Steps to Reproduce:

  1. Visit https://pokeapi.co/api/v2/pokemon/25 and see Internal Server Error
  2. Visit https://pokeapi.co/api/v2/pokemon/25/ and see data
Image Image

curl requests like before:

curl -I https://pokeapi.co/api/v2/pokemon/25
HTTP/2 500 
date: Mon, 24 Nov 2025 00:37:18 GMT
content-type: text/plain; charset=utf-8
access-control-allow-origin: *
cache-control: public, max-age=432000, s-maxage=432000
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=neWNrQ4yoD1L4sFif7AX39MvS87zzUpny2A1OXfwy4smi6kyEtVnyy8ewymwt8%2FSIK6R%2Fi2NVV3F2Qwaf%2FfxQKFrOpdtY6KeEl2ae5Kxwow50a7b"}]}
etag: W/"15-/6VXivhc2MKdLfIkLcUE47K6aH0"
function-execution-id: 0oylb0bx3ruk
server: cloudflare
x-cloud-trace-context: 1be6cf1a786780c2b6968f656a9e53c7
x-powered-by: Express
fastly-restarts: 1
x-served-by: cache-lga21976-LGA
x-cache: MISS
x-cache-hits: 0
x-timer: S1763468950.406089,VS0,VE2684
vary: Accept-Encoding, x-fh-requested-host, accept-encoding
alt-svc: h3=":443"; ma=86400
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
age: 372737
cf-cache-status: HIT
cf-ray: 9a34d6453fab32f5-JAX
curl -I https://pokeapi.co/api/v2/pokemon-species/25/
HTTP/2 200 
date: Mon, 24 Nov 2025 00:36:21 GMT
content-type: application/json; charset=utf-8
access-control-allow-origin: *
cache-control: public, max-age=86400, s-maxage=86400
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
etag: W/"b6e5-ybPGrKPeCiJaxD9jTUOLFEgHcwE"
function-execution-id: iv5awlevrjru
server: cloudflare
strict-transport-security: max-age=31556926
x-cloud-trace-context: c876146e8a4d6bf3e5c7edb16a0e5c41
x-country-code: US
x-orig-accept-language: en-US,en;q=0.9
x-powered-by: Express
x-served-by: cache-chi-kigq8000086-CHI
x-cache: HIT
x-cache-hits: 0
x-timer: S1761095439.038515,VS0,VE12
vary: Accept-Encoding,cookie,need-authorization, x-fh-requested-host, accept-encoding
alt-svc: h3=":443"; ma=86400
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=VsEY5HDHCxactavF19yJT0cSgnD78FHVNJQuJpu%2Ft%2B0joDp9fvH003M3M6Jsj0iWFRG2wFfiUVqq6tL4lyigxrVed4NMiC%2FDombacABA6MOutuAf"}]}
cf-cache-status: HIT
cf-ray: 9a34d4e09e9d68ca-JAX

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions