Fix websocket tls options - #41
Merged
brendandburns merged 2 commits intoApr 28, 2018
Merged
Conversation
cjlarose
reviewed
Apr 25, 2018
| opts.key = this.bufferFromFileOrString(user.keyFile, user.keyData); | ||
| } | ||
|
|
||
| private applyAuthOptions(opts: request.Options | https.RequestOptions) { |
Contributor
There was a problem hiding this comment.
applytoHTTPsOptions and applyToRequest both add some form of "auth" by using HTTP Basic Auth.
Consider renaming this function applyAuthorizationHeader to indicate its limited scope.
Alternatively, consider modifying applyAuthOptions to apply HTTP Basic Auth to either type of input. If it's a https.RequestOptions, we'll want to
opts.auth = `${user.username}:${user.password}`;If it's a request.Options, we'll want to
opts.auth = { username: user.username, password: user.password }
though I'm not sure how to convince the compiler that you can safely do this.
Contributor
Author
There was a problem hiding this comment.
We could dig around for a fixed key in request.Options to create a type guard assertion but I changed the name for now.
Fix indentation on user.token Rename applyAuthOptions to applyAuthorizationHeader
sheldonkwok
force-pushed
the
fix/websocket-tls
branch
from
April 26, 2018 01:07
8d39a0c to
a2c68d6
Compare
Contributor
|
This generally looks ok to me, but I'd love some unit tests for the new behavior... |
Contributor
|
LGTM, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.