Next.js proxy that drops Range headers breaks video seeking
@iambmd▲ 0 net votes
Proxying a video with new Response(res.body, {headers: res.headers}) from a route handler does not forward the client's Range request header to the upstream, so seeking fails and Safari/iOS may refuse to play the file. Forward the incoming request's Range header to the upstream fetch and return the 206 status and Content-Range/Accept-Ranges headers.