Code Monkey home page Code Monkey logo

Comments (6)

theturtle32 avatar theturtle32 commented on July 21, 2024

Interesting. Looking into this now.

from websocket-node.

theturtle32 avatar theturtle32 commented on July 21, 2024

Fixed. Here's my description from the commit message:

I'm still maintaining lower case subprotocol names internally, but now am maintaining a mapping in the request object to the exact subprotocol string requested by the client, so that exact string can be returned in the response. This allows us to maintain case insensitivity in subprotocol names for practicality, but to return the exact casing of a subprotocol expected by the client.

from websocket-node.

jamesjenner avatar jamesjenner commented on July 21, 2024

Thanks for the change 👍 , however I noticed that you've added in a line stating:

this.requestedProtocols = null;

Which is resulting in it being set to null. It's easy to work around but previously this wasn't happening so the change broke my code.

It's only minor but after reviewing what was changed I wondered if it made sense to clear out the requested protocols after accepting a protocol, it still may be handy to know what was originally requested. You're only doing it when protocolFullCase, not sure on the conditions around this.

I'm not worried either way, just thought I would mention it.

Cheers :-)

from websocket-node.

theturtle32 avatar theturtle32 commented on July 21, 2024

I nulled it because its not useful after the connection has been accepted: the protocol that was chosen to be spoken on the wire is available in connection.protocol. After the connection is accepted, any other protocols suggested by the client that weren't accepted are irrelevant. If you really need them, you can save the value of request.requestedProtocols before calling request.accept().

Happy new year!!!

Brian

Sent from my iPhone

On Dec 31, 2012, at 9:02 PM, James Jenner [email protected] wrote:

Thanks for the change , however I noticed that you've added in a line stating:

this.requestedProtocols = null;
Which is resulting in it being set to null. It's easy to work around but previously this wasn't happening so the change broke my code.

It's only minor but after reviewing what was changed I wondered if it made sense to clear out the requested protocols after accepting a protocol, it still may be handy to know what was originally requested.

I'm not worried either way, just thought I would mention it.

Cheers :-)


Reply to this email directly or view it on GitHub.

from websocket-node.

theturtle32 avatar theturtle32 commented on July 21, 2024

In fact, the entire request object is meant to be garbage collected after accepting the connection, so I recommend not holding a reference to it in order to optimize memory consumption.

Sent from my iPhone

On Dec 31, 2012, at 9:02 PM, James Jenner [email protected] wrote:

Thanks for the change , however I noticed that you've added in a line stating:

this.requestedProtocols = null;
Which is resulting in it being set to null. It's easy to work around but previously this wasn't happening so the change broke my code.

It's only minor but after reviewing what was changed I wondered if it made sense to clear out the requested protocols after accepting a protocol, it still may be handy to know what was originally requested.

I'm not worried either way, just thought I would mention it.

Cheers :-)


Reply to this email directly or view it on GitHub.

from websocket-node.

fresheneesz avatar fresheneesz commented on July 21, 2024

@theturtle32 I seem to still be getting this problem. I'm using 1.0.8 (taken from npm) and I have the exact problem as mentioned a year ago. Why is this case being manipulated at all?

from websocket-node.

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.