URL fragment bug in Pages redirects

I found a bug in how Cloudflare Pages handles redirects. See an example project at redirect-bug.pages.dev that shows this.

The only thing in that project is a _redirects file that looks like this:

/ https://google.com/#joe

The bug is that Pages is duplicating the fragment at the end of the URL. If we hit that site with curl we get this:

$ curl -i https://redirect-bug.pages.dev/
HTTP/2 302 
date: Sat, 13 Apr 2024 02:07:36 GMT
content-type: text/plain;charset=UTF-8
content-length: 42
location: https://google.com/#joe#joe
access-control-allow-origin: *
referrer-policy: strict-origin-when-cross-origin
x-content-type-options: nosniff
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=G1jX4q0JlaaD6GEMs0iqYDten4H6Hc0fLBVLXU3s0iOu88MNUS9NEgosmJDP1KRI2XNg09SSV1h1qGlSdotgEKFal%2FIgsU%2B2IiPL%2FRV2%2BZyzoMSxAl0%2FohQl250AUvU1amJa%2BLqcvNzl"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 8737e74a391c112d-ORD
alt-svc: h3=":443"; ma=86400

Redirecting to https://google.com/#joe#joe

Note the duplicated fragment of #joe#joe in both the location header and the body of the response. Some sort of URL parsing bug in the redirects feature?