Coder Social home page Coder Social logo

`c.req.url` is always http about node-server HOT 7 CLOSED

hilja avatar hilja commented on June 9, 2024 1
`c.req.url` is always http

from node-server.

Comments (7)

seep avatar seep commented on June 9, 2024 1

This line seems to be the issue: https://github.com/honojs/node-server/blob/main/src/request.ts#L120 The request shim has the HTTP protocol hard coded.

from node-server.

usualoma avatar usualoma commented on June 9, 2024 1

Hi @hilja Thanks for creating the issue.

Hi @seep Thanks for the reference info.

Indeed, when using 'node:http2' or 'node:https', it certainly looks better to be https:. I will create a PR for the change.

As for the x-forwarded-proto, I think it should be handled on the application side. Or if there are a lot of requests, we could provide a hook point that can be rewritten. Anyway, I think it is better not to handle x-forwarded-proto implicitly.

from node-server.

m4nuC avatar m4nuC commented on June 9, 2024

Any luck on that one ? I have the same issue

from node-server.

seep avatar seep commented on June 9, 2024

We're seeing this as well with https.createServer.

from node-server.

yusukebe avatar yusukebe commented on June 9, 2024

@hilja Thanks for raising the issue.

Hi @usualoma , as @seep mentioned, I think we can fix the line. Can you take a look?

from node-server.

seep avatar seep commented on June 9, 2024

If it helps, I was able to work around this by pulling the IncomingMessage object out of the request and checking incoming.socket.encrypted. I think you can do the same here for the fix. When using https.createServer the socket will be an instance of tls.TLSSocket instead of net.Socket. For reference: https://nodejs.org/api/tls.html#tlssocketencrypted

from node-server.

usualoma avatar usualoma commented on June 9, 2024

Created #155

from node-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.