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

COMException reading WebResourceResponse content #3229

Closed
m4wayne opened this issue Feb 18, 2023 · 14 comments
Closed

COMException reading WebResourceResponse content #3229

m4wayne opened this issue Feb 18, 2023 · 14 comments
Assignees
Labels
tracked We are tracking this work internally.

Comments

@m4wayne
Copy link

m4wayne commented Feb 18, 2023

In CoreWebView2.WebResourceResponseReceived EventHandler, I use Response.GetContentAsync to get the response content and get the following error:
image

-----------------------------------------------------Split line---------------------------------------------------------

image

These codes were working fine before, and they are not working since yesterday.The error usually received is "The pipe is being closed. (0x800700E8)", the other error "No class registered" is present only once. I've looked at #1839 and #1826 and haven't been able to solve the problem I'm having.
Updated the windows patch yesterday, I still get the same error after uninstalling the patch.
image

Here is the record I intercepted using Fiddler.Exception An error occurred while intercepting the sequence number 9 response.The response content of serial number 9 is normal when displayed in the browser.
image

Who can help me, thanks!

WebView2: 1.0.1264.42 and 1.0.1587.40
Runtime: 110.0.1587.50
Framework: .NET6 Winform
OS: Win10 22H2(19045.2604)
Visual Studio:Community 2022 (64 位) - Current版本 17.4.5

The above content was machine translated by Google, so the content may be a little strange.

AB#43494200

@m4wayne
Copy link
Author

m4wayne commented Feb 18, 2023

After the computer is started, the first test result of the program is "No class registered" error, and all subsequent test results are "The pipe is being closed. (0x800700E8)" error.

@m4wayne
Copy link
Author

m4wayne commented Feb 19, 2023

After testing, it is found that Response.GetContentAsync() will report an error after getting the redirected response body (the response status code is 200, and the response body has data). Redirects include 301, 302, 307, 308

@m4wayne
Copy link
Author

m4wayne commented Feb 19, 2023

Just tested in the 109.0.1518.78 runtime environment, the Response.GetContentAsync code can run normally. Is this an unknown bug of 110.0.1587.x? I have the same error when running on 110.0.1587.46.
Please help me!

@novac42
Copy link
Contributor

novac42 commented Feb 20, 2023

Thanks for reaching out. I've assigned this to a dev that can help follow up on this.

@m4wayne
Copy link
Author

m4wayne commented Feb 21, 2023

@ElyssaJyu @novac42 Thanks for following up.

@ElyssaJyu
Copy link

Hi @m4wayne, could you give a description about your scenario and provide a sample project that I can simply repo the exception? It will be easier to find the root cause. Thanks.

@m4wayne
Copy link
Author

m4wayne commented Feb 22, 2023

Hi @ElyssaJyu
I use WebView2 to open a web page. In the WebResourceResponseReceived() function, the program determines what to do next according to the content returned by the GetContentAsync() function.

WebView2: 1.0.1587.40
Runtime: 110.0.1587.50 or 109.0.1518.78
Framework: .NET6
OS: Win10 22H2(19045.2604)
Visual Studio:Community 2022 (64 位) - Current版本 17.3.6

WebView2Demo usage guide:

  1. Start the WebSimulator,for example: cd WebSimulator && dotnet run
  2. Start the WebView2Demo
  3. Click the "Login" button
  4. Observe the content of the Visual Studio output window
  5. Use different runtime versions, such as 109.0.1518.78 or 110.0.1587.x
    At the same time, I provide the program running gif file and Fiddler packet capture record for your reference.Thanks.
    https://github.com/m4wayne/WebView2Demo

@ElyssaJyu ElyssaJyu added the tracked We are tracking this work internally. label Feb 24, 2023
@ElyssaJyu
Copy link

ElyssaJyu commented Feb 24, 2023

Hi @m4wayne, thanks for your provided details. I have cloned your project and saw the expception.gif. Also, I saw the comment in issue 1839.

There is an exception will be thrown if the response body is empty for 302/307 redirect and other https request with 200 works fine. Response code should give the content.

Will this resolve your question?
You mentioned runtime 109.0.1518.78 works with no exception, but 110.0.1587.x will throw it. I will continue investigating on it. Thanks.

@m4wayne
Copy link
Author

m4wayne commented Feb 25, 2023

Hi @ElyssaJyu,#1839 (comment) didn't solve my problems.
The page content I need to get comes from the response after redirection(302). This is a third-party website, and I cannot change it.
Did you receive the same error when running the WebView2Demo project I provided?
It is gratifying that 109.0.1518.78 can work normally at present. I have specified the runtime used by the project as 109.0.1518.78. So it has no impact on my work progress.
Take your time, thanks.

@ElyssaJyu
Copy link

Hi @m4wayne, we've tracked it internally, and I will sync with you later. Thanks for your provided info.

@m4wayne
Copy link
Author

m4wayne commented Feb 27, 2023

Great! Thanks for getting back to me!
@ElyssaJyu

@RoederSi
Copy link

Having a similar issue with win32 webview2 browser.
Trying to get the response content after redirects (302) always returns the result ERROR_NO_DATA, although there is content. This happens for the original (302) request and the redirected (200) which used to return content before runtime version 110.0.1587.x.
I would appreciate any info on this issue.

@champnic
Copy link
Member

champnic commented Jun 7, 2023

This should be fixed in WebView2 runtimes version 116.0.1902.0+. Thanks!

@champnic champnic closed this as completed Jun 7, 2023
@m4wayne
Copy link
Author

m4wayne commented Jun 16, 2023

Thanks all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

6 participants
@novac42 @m4wayne @champnic @RoederSi @ElyssaJyu and others