Skip to content

Adds Mock HTTP tests to HttpHAuthorizationHeader requests.#532

Merged
eddynaka merged 10 commits into
mainfrom
users/Bpednragon/MockHTTPAuth
Aug 11, 2021
Merged

Adds Mock HTTP tests to HttpHAuthorizationHeader requests.#532
eddynaka merged 10 commits into
mainfrom
users/Bpednragon/MockHTTPAuth

Conversation

@Bpendragon

Copy link
Copy Markdown
Contributor

No description provided.

By force resetting the static instance, we allow the old test to make the call it wanted to.
Comment thread Src/Sarif.PatternMatcher.Sdk/ValidatorBase.cs Outdated
HttpClient client = CreateOrRetrieveCachedHttpClient();
using var requestDummy = new HttpRequestMessage(HttpMethod.Get, uri);
requestDummy.Headers.Authorization = new AuthenticationHeaderValue("Basic", ScanIdentityGuid);
if (options.ContainsKey("TestGuid"))

@eddynaka eddynaka Aug 11, 2021

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ContainsKey

switch to trygetvalue, this will retrieve in one shot if that exists and if that contains a value #Closed

@eddynaka eddynaka left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@eddynaka eddynaka enabled auto-merge (squash) August 11, 2021 17:17
@eddynaka eddynaka merged commit c4214dc into main Aug 11, 2021
@eddynaka eddynaka deleted the users/Bpednragon/MockHTTPAuth branch August 11, 2021 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants