crossorigin issues in gerrit version 2.14.4

42 views
Skip to first unread message

cedar.b...@gmail.com

unread,
Jul 25, 2018, 2:12:56 AM7/25/18
to Repo and Gerrit Discussion
Hi,

So I am using the polygerrit version 2.14.4 and it seems that the below two links on the home page don't have cross-origin set to anonymous:

<link rel="preloadhref="/fonts/SourceCodePro-Regular.woff2", as="fonttype="font/woff2crossorigin>
<link rel="preloadhref="/fonts/SourceCodePro-Regular.woffas="fonttype="font/woffcrossorigin>

The third one, however, is fine: 
<link rel="preload" href="/elements/gr-app.js" as="script" crossorigin="anonymous">

Is this intentional and is there a way to fix it? 

Thanks,
--Jason

Gert van Dijk

unread,
Jul 25, 2018, 3:17:27 AM7/25/18
to Repo and Gerrit Discussion
The HTML attributes you're seeing are part of the template in the source code. It mentions the following comment regarding the use of the 'crossorigin' attribute:
  // @see https://github.com/w3c/preload/issues/32 regarding crossorigin

In that GitHub issue, the use of 'anonymous' is discussed, but I don't seem to understand the details of this.

It makes sense to me to explicitly fetch fonts anonymously (ie. without cookies or other credentials), but wouldn't it also put up a burden for those who will have a simple authenticating reverse proxy installed which simply restricts '/' on the Gerrit site? Hmm, well, as you mentioned in your post, already another resource (script) is marked anonymously for CORS and that would work the same way.

If we agree on that it is 'broken' currently, please file a bug report and we can (easily) solve this. I'm not aware of any way to override the main HTML page as a site-local configuration, but others may know a way.

FWIW - I checked the situation on stable-2.15 and master and it's unchanged (just the font itself has been replaced by Roboto).

cedar.b...@gmail.com

unread,
Jul 25, 2018, 12:58:30 PM7/25/18
to Repo and Gerrit Discussion
Okay, I will file a bug report and possibly add information here about it. Thank You

Thanks!

cedar.b...@gmail.com

unread,
Jul 25, 2018, 3:02:02 PM7/25/18
to Repo and Gerrit Discussion
Reply all
Reply to author
Forward
0 new messages