[Webkit-unassigned] [Bug 191858] [GTK] Unexpected User-Agent on redirect

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 1 07:31:17 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=191858

--- Comment #19 from Carlos Garcia Campos <cgarcia at igalia.com> ---
(In reply to Michael Catanzaro from comment #18)
> Comment on attachment 407676 [details]
> 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.

Not exactly, because now we are clearing the user agent on redirect, so before this patch we received the previous user agent here, now it's empty, if we don't fill it here we will end up with no user agent in the request.

> > 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?

Right, that's why I added Fujii to the CC.

-- 
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/17d9c88d/attachment.htm>


More information about the webkit-unassigned mailing list