-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Credential fixes #61114
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
Merged
Merged
Credential fixes #61114
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -399,7 +399,7 @@ public async Task PostAsync_ManyDifferentRequestHeaders_SentCorrectly() | |
| } | ||
|
|
||
| const string content = "hello world"; | ||
|
|
||
| string authSafeValue = "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="; | ||
| // Using examples from https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields | ||
| // Exercises all exposed request.Headers and request.Content.Headers strongly-typed properties | ||
| await LoopbackServerFactory.CreateClientAndServerAsync(async uri => | ||
|
|
@@ -421,7 +421,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => | |
| request.Headers.Add("Access-Control-Request-Method", "GET"); | ||
| request.Headers.Add("Access-Control-Request-Headers", "GET"); | ||
| request.Headers.Add("Age", "12"); | ||
| request.Headers.Authorization = new AuthenticationHeaderValue("Basic", "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="); | ||
| request.Headers.Authorization = new AuthenticationHeaderValue("Basic", authSafeValue); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just curious, how did extracting this into a variable help credscan? |
||
| request.Headers.CacheControl = new CacheControlHeaderValue() { NoCache = true }; | ||
| request.Headers.Connection.Add("close"); | ||
| request.Headers.Add("Cookie", "$Version=1; Skin=new"); | ||
|
|
@@ -444,7 +444,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => | |
| request.Headers.MaxForwards = 10; | ||
| request.Headers.Add("Origin", "http://www.example-social-network.com"); | ||
| request.Headers.Pragma.Add(new NameValueHeaderValue("no-cache")); | ||
| request.Headers.ProxyAuthorization = new AuthenticationHeaderValue("Basic", "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="); | ||
| request.Headers.ProxyAuthorization = new AuthenticationHeaderValue("Basic", authSafeValue); | ||
| request.Headers.Range = new RangeHeaderValue(500, 999); | ||
| request.Headers.Referrer = new Uri("http://en.wikipedia.org/wiki/Main_Page"); | ||
| request.Headers.TE.Add(new TransferCodingWithQualityHeaderValue("trailers")); | ||
|
|
@@ -504,15 +504,15 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => | |
| Assert.Equal("GET", requestData.GetSingleHeaderValue("Access-Control-Request-Headers")); | ||
| } | ||
| Assert.Equal("12", requestData.GetSingleHeaderValue("Age")); | ||
| Assert.Equal("Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", requestData.GetSingleHeaderValue("Authorization")); | ||
| Assert.Equal($"Basic {authSafeValue}", requestData.GetSingleHeaderValue("Authorization")); | ||
| Assert.Equal("no-cache", requestData.GetSingleHeaderValue("Cache-Control")); | ||
| if (PlatformDetection.IsNotBrowser) | ||
| { | ||
| Assert.Equal("$Version=1; Skin=new", requestData.GetSingleHeaderValue("Cookie")); | ||
| Assert.Equal("Tue, 15 Nov 1994 08:12:31 GMT", requestData.GetSingleHeaderValue("Date")); | ||
| Assert.Equal("100-continue", requestData.GetSingleHeaderValue("Expect")); | ||
| Assert.Equal("http://www.example-social-network.com", requestData.GetSingleHeaderValue("Origin")); | ||
| Assert.Equal("Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", requestData.GetSingleHeaderValue("Proxy-Authorization")); | ||
| Assert.Equal($"Basic {authSafeValue}", requestData.GetSingleHeaderValue("Proxy-Authorization")); | ||
| Assert.Equal("Mozilla/5.0", requestData.GetSingleHeaderValue("User-Agent")); | ||
| Assert.Equal("http://en.wikipedia.org/wiki/Main_Page", requestData.GetSingleHeaderValue("Referer")); | ||
| Assert.Equal("MyTrailer", requestData.GetSingleHeaderValue("Trailer")); | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
credscan picked up on the "realm" part here? but not on line 204? It is strange...