-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[wasm][testing] Avoid using crypto in WASM HTTP unit tests #53925
[wasm][testing] Avoid using crypto in WASM HTTP unit tests #53925
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsOn WASM platform POST/PUT tests are blocked by current lack of crypto in WASM.
|
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsOn WASM platform POST/PUT tests are blocked by current lack of crypto in WASM.
|
4d4915e
to
939e7cf
Compare
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.
LGTM, thanks!
src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs
Outdated
Show resolved
Hide resolved
...ibraries/Common/tests/System/Net/Prerequisites/NetCoreServer/Handlers/VerifyUploadHandler.cs
Outdated
Show resolved
Hide resolved
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.
Looks good, just a couple of comments.
src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs
Outdated
Show resolved
Hide resolved
...ibraries/Common/tests/System/Net/Prerequisites/NetCoreServer/Handlers/VerifyUploadHandler.cs
Outdated
Show resolved
Hide resolved
@@ -358,7 +364,16 @@ public async Task PostAsync_CallMethodTwice_StringContent(Configuration.Http.Rem | |||
|
|||
// Repeat call. | |||
content = new StringContent(data, Encoding.UTF8); | |||
content.Headers.ContentMD5 = TestHelper.ComputeMD5Hash(data); | |||
if (PlatformDetection.IsBrowser) |
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.
Should you have this extracted to a method to reduce copy&paste? :-)
On WASM platform existing POST/PUT tests are blocked by current lack of crypto in WASM.
By skipping content checksum validation in the tests for Browser, we could enable about 130 tests of other HTTP features.
Content-MD5-Skip
header instead ofContent-MD5
header from browserContent-MD5-Skip
is presentContent-MD5
response validationSendAsync_SendRequestUsingMethodToEchoServerWithContent_Success
more granular active issue [wasm][HTTP] TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body #53591SendAsync_GetWithValidHostHeader_Success