[Webkit-unassigned] [Bug 191858] [GTK] Unexpected User-Agent on redirect
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Sep 1 07:27:49 PDT 2020
https://bugs.webkit.org/show_bug.cgi?id=191858
--- Comment #18 from Michael Catanzaro <mcatanzaro at gnome.org> ---
Comment on attachment 407676
--> https://bugs.webkit.org/attachment.cgi?id=407676
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=407676&action=review
Much nicer!
> Source/WebKit/UIProcess/API/glib/WebKitDownloadClient.cpp:60
> + void willSendRequest(DownloadProxy& downloadProxy, ResourceRequest&& request, const ResourceResponse&, CompletionHandler<void(ResourceRequest&&)>&& completionHandler) override
> + {
> + if (!request.hasHTTPHeaderField(HTTPHeaderName::UserAgent)) {
> + GRefPtr<WebKitDownload> download = webkitWebContextGetOrCreateDownload(&downloadProxy);
> + auto* webView = webkit_download_get_web_view(download.get());
> + request.setHTTPUserAgent(webView ? webkitWebViewGetPage(webView).userAgentForURL(request.url()) : WebPageProxy::standardUserAgent());
> + }
> +
> + completionHandler(WTFMove(request));
> + }
I would do it in a separate bug (with r=me), since it's really an additional fix on top of the primary fix. But whatever.
> Source/WebKit/UIProcess/playstation/WebPageProxyPlayStation.cpp:49
> +String WebPageProxy::userAgentForURL(const URL&)
> +{
> + return userAgent();
> +}
I understand from your previous comments that PlayStation port does have user agent quirks that depend on URL, and you just haven't implemented it here, so action is required for PlayStation port? Is that right, or do I misunderstand?
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200901/a8fcbe0f/attachment.htm>
More information about the webkit-unassigned
mailing list