Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting cookies of a request without having to pass response argument #127

Closed
ghost opened this issue Aug 14, 2020 · 2 comments
Closed

Getting cookies of a request without having to pass response argument #127

ghost opened this issue Aug 14, 2020 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Aug 14, 2020

Hi! I need to get a certain cookie when the server emits the 'upgrade' event:

server.on('upgrade', (request: IncomingMessage, socket: Socket, head: Buffer) => {
    // get request cookie here
})

Is it possible to do this? From what I can see inspecting the source code it should be, but if I emit the response parameter typescript complains. Is this a @types/cookies issue then?

@dougwilson
Copy link
Contributor

We have a lower level module mode made for your use case, does that work for you? https://github.com/jshttp/cookie

@ghost
Copy link
Author

ghost commented Aug 14, 2020

Great! Thank you.

@ghost ghost closed this as completed Aug 14, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant