0

I'm trying to render a online page on UWP WebView, the page send a request to backend and will got a 307 error for temporary redirect to another url. But WebView won't handle the 307 redirection.

I also tried to load the online page on modern browsers and it works well. All modern browsers will automatically detect the 307 Temporary Redirect response code and process the redirection action to new URI automatically.

I want to know is there any way to make the UWP WebView to hande to the 307 redirection? Thank you!

jerry
  • 317
  • 2
  • 20
  • Hi, can you provide some code snippets to show how to navigate? And you can try to listen to the `WebView.NavigationFailed` event and get the navigation Uri in the event parameters – Richard Zhang Oct 27 '20 at 07:02
  • I use the Navigate(new Uri(url)) to render a online page on WebView, JS in the page will send a request to backend and will get the 307 Temporary Redirect response code. It seems the WebView can't handle the redirection. – jerry Oct 27 '20 at 07:41
  • Hello, when your server backend returns 307, if you can get the response header, which should contain the redirected address, you can manually call WebView.Navigate(Uri) to handle the redirection – Richard Zhang Oct 27 '20 at 08:44
  • No, I can't do that. The WebView render the online page, there are a lots requests send by JS in this page. No need to navigate to another page and I also checked the JS also can't get the redirected address. – jerry Oct 28 '20 at 04:08
  • Hello, can you provide a link to the web page and steps to reproduce so that we can test this issue? Or you can make a feature request in the Feedback Hub app. – Richard Zhang Oct 28 '20 at 07:11
  • Sorry, the link can't be accessed in the internet. Anyway thank you for the comments. – jerry Oct 28 '20 at 11:13

0 Answers0