Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(683)

Issue 1578993002: Fix double resource request for script resources with integrity attr. (Closed)

Created:
4 years, 11 months ago by jww
Modified:
4 years, 11 months ago
Reviewers:
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src@2564
Target Ref:
refs/pending/branch-heads/2564
Project:
chromium
Visibility:
Public.

Description

Fix double resource request for script resources with integrity attr. Script tags with an integrity attribute were making two network requests for the same resource for each tag. This would only happen if the script tag appeared in the HTML of the page, but not if it was added programmatically. This was because the preloader was requesting the resource, but not checking the integrity attribute, and when the actual request came around, it had to re-request the resource because of the integrity metadata (see https://chromium.googlesource.com/chromium/src/+/175dcb80d2d369bd7ce55b46d72971395c21a932 for a description of why this re-request for scripts is needed if there is no integrity metadata on the first request). Thus the solution to this is to check the integrity metadata in the preloader. This adds a check in the preloader where, if the resource is a script, it checks the integrity attribute and adds the appropriate integrity metadata. When the script is requested for real later, the returned resource now has the integrity metadata and no re-request is needed. BUG=573269 Review URL: https://codereview.chromium.org/1561903002 Cr-Commit-Position: refs/heads/master@{#367888} (cherry picked from commit 271be402092404bd04b2881ec7301a8fe0c58964) Committed: https://chromium.googlesource.com/chromium/src/+/2a1d9665458194a812f7de643eb3681cbf83b8c8

Patch Set 1 #

Messages

Total messages: 2 (1 generated)
jww
4 years, 11 months ago (2016-01-11 22:50:20 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
2a1d9665458194a812f7de643eb3681cbf83b8c8.

Powered by Google App Engine
This is Rietveld 408576698