solid-start
solid-start copied to clipboard
[Bug?]: preserve original web Request
Duplicates
- [x] I have searched the existing issues
Latest version
- [x] I have tested the latest version
Current behavior 😯
getRequestEvent()?.nativeEvent.web?.request.cf?.country
is undefined in wrangler pages dev dist because this isn't the original h3 web request which includes cf properties
Expected behavior 🤔
if you run this in cloudflare, you'll get a string:
import { createApp, toWebHandler } from "h3";
export default {
fetch: toWebHandler(
createApp().use("/", (e) => {
return new Response(e.web?.request?.cf?.country);
})
),
};
Steps to reproduce 🕹
see above
Context 🔦
workaround is getRequestEvent()?.nativeEvent.context
Your environment 🌎