unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
6.03k stars 497 forks source link

Server Timing Headers Contain Url Encoding #1176

Open hecktarzuli opened 1 year ago

hecktarzuli commented 1 year ago

Environment

Node 18.15.0 Nitro 2.3.3

Reproduction

add this to your nuxt config file

nitro: {
  timing: true
}

do a nuxt build, nuxt preview inspect the response headers from the page hit in your browser

Describe the bug

When setting nitro.timing: true in nuxt.config.ts, the timing names returned are url encoded instead of normal.

Notice the %20 for spaces, and %2F for / etc.. image image

Additional context

In Nuxt 2, these were spaces and they looked correct. image

Logs

No response

peterroe commented 1 year ago

Actually does encodeURIComponent for the server-time in code @hecktarzuli : https://github.com/unjs/nitro/blob/b320208963d0aaa48ba394e00ec14cca40271045/src/runtime/timing.ts#L11-L34

peterroe commented 1 year ago

According to MDN's standard, should we follow the standard? @pi0

hecktarzuli commented 1 year ago

cc @danielroe