Skip to content

request ip unavailable in web handler #968

Open
@huseeiin

Description

@huseeiin

Environment

Bun 1.2.0
H3 1.13.0

Reproduction

import { createApp, getRequestIP, toWebHandler } from "h3";

export default {
    fetch: toWebHandler(createApp().use((ev) => typeof getRequestIP(ev))),
};

Describe the bug

when using node adapter (in bun or deno), this bug doesn't happen and the ip exists:

import { createApp, getRequestIP, toNodeListener } from "h3";
import { createServer } from "http";

createServer(
    toNodeListener(createApp().use((ev) => typeof getRequestIP(ev)))
).listen(3000);

Additional context

same bug in deno and wrangler dev (cloudflare)

Logs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions