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

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


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

--- Comment #10 from youenn fablet <youennf at gmail.com> ---
(In reply to Carlos Garcia Campos from comment #8)
> (In reply to youenn fablet from comment #6)
> > Comment on attachment 407598 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=407598&action=review
> > 
> > > Source/WebKit/ChangeLog:9
> > > +        request when needsSiteSpecificQuirks setting is enabled.
> > 
> > It seems tests are missing here. Can we write some?
> 
> It's not easy to test I'm afraid. The user agent changes depending on the
> site, only when site specific quirks setting is enabled. In tests the host
> is always localhost. We would need a way to set quirks only used for testing
> for localhost (and not for 127.0.0.1, for example).

Seems fine.
We can also think of using API tests as well.
Quirks are currently based on URL, maybe we can add schemes/port specific handling as part of testing.

> 
> > Also, it seems the patch adds a generic boolean but setting the user agent
> > value is platform specific.
> 
> Because the boolean is not specific to the user agent, it's the site
> specific quirks setting, but it's true it's currently used only by GTK port
> to set the user agent.
> 
> > Currently, the work is mostly done in WebProcess with platform agnostic
> > code, computation of the user agent value being done by WebPage.
> 
> There's WebPage::platformUserAgent() that right now it's only implemented by
> iOS and Playstation ports. In the case of the iOS port, the change in the
> user agent doesn't really depend on the URL, but I think playstation also
> needs to be fixed, moving the user agent quirks to the network process. 
> 
> > How is the computation of this value supposed to work in NetworkProcess?
> 
> We can't just use a fixed user agent for all websites like major browsers
> do, because we get messages of unsupported browser, or features disabled, or
> things simply don't work. So, we need to pretend to be other browsers in
> some cases depending on the website. That's what we do in
> WebPage::platformUserAgent(). The problem is that after a redirection, we
> copy the user agent from the previous request, but the redirected URL might
> require a different user agent to work. You can see an¡ example of how this
> can break things in https://bugs.webkit.org/show_bug.cgi?id=215845#c3. So,
> in case of redirections we need to apply the user agent quirks again, but we
> are in the network process now. So, this patch moves the user agent quirks
> to the network process ensuring they are always applied, for the initial
> request, for downloads, and for the new request after a redirection.

Which requests are triggering the issue?
Navigation loads should probably be fine since WebProcess is dealing with this issue properly.
That would leave sub resources and downloads.
Is the main issue downloads?

-- 
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/5656e6a8/attachment.htm>


More information about the webkit-unassigned mailing list