Duplicates
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 π
Duplicates
Latest version
Current behavior π―
is
undefinedinwrangler pages dev distbecause this isn't the original h3 web request which includes cf propertiesExpected behavior π€
if you run this in cloudflare, you'll get a string:
Steps to reproduce πΉ
see above
Context π¦
workaround is
getRequestEvent()?.nativeEvent.contextYour environment π