• Dominick Ng's avatar
    Add request_initiator to the WebApkIconHasher's icon fetch. · e677556d
    Dominick Ng authored
    The WebAPK icon hasher makes a no-CORS fetch request for the primary and
    badge icons for creating WebAPKs. Before this CL, the request was made
    without setting a request_initiator on the fetch request. When the
    requested image is protected by Cross-Origin-Resource-Policy: same-site,
    the lack of initiator causes the fetch to fail and WebAPK creation fails
    as a result.
    
    This CL fixed the issue by setting the initiator to the origin of the
    requested start URL for the WebAPK. A test is added to ensure correct
    behaviour.
    
    BUG=977829
    
    Change-Id: I308a21667b42e9f4c46806deda261fbebfeb46a3
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1673671
    Commit-Queue: Dominick Ng <dominickn@chromium.org>
    Reviewed-by: default avatarPeter Kotwicz <pkotwicz@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#671934}
    e677556d
webapk_icon_hasher_unittest.cc 5.24 KB