CARVIEW |
Select Language
HTTP/2 200
date: Mon, 06 Oct 2025 07:29:05 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/jquery/jquery.git
etag: W/"701d6a5e49f955b2e5e7a8e3227c07a3"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=6ygUH96%2BhG9TV4vQ79z02drM84JB8uOaH5wxu0z2VrGR8TNL2%2F2yAlkPTpGPl8R5jpc8xBBToPfxYtD%2BD1xmzZ7DJU%2BYpz3EHcQ8YINKVfvoPB0%2BC0KtLbSvwHI9fRAl0MSMUKPq41JIJrXB%2FB54y4a%2Fu2lXRJIhN3ovWuNeBOYLO3SQMOVOmvdM3NZJ9L3Nu20IqRWKmVbGNu0GgtixBecauN05bdat70AfGPAXVQ9%2F0ir66twgHj06PJqKScrFgeA3mI9mMabj2qryg3o9jQ%3D%3D--%2Fv%2FoNSwQ7mO1VvlE--IwJ%2FJDGNrMDapdtztBXUFw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.983771874.1759735744; Path=/; Domain=github.com; Expires=Tue, 06 Oct 2026 07:29:04 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Tue, 06 Oct 2026 07:29:04 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 86A4:3EC2A4:1EA90F2:2742C3F:68E36FC0
Ajax: Avoid CSP errors in the script transport for async requests · jquery/jquery@07a8e4a · GitHub
Copy file name to clipboard
Copy file name to clipboard
Copy file name to clipboard
Copy file name to clipboardExpand all lines: test/middleware-mockserver.js
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Commit 07a8e4a
authored
Ajax: Avoid CSP errors in the script transport for async requests
Until now, the AJAX script transport only used a script tag to load scripts
for cross-domain requests or ones with `scriptAttrs` set. This commit makes
it also used for all async requests to avoid CSP errors arising from usage
of inline scripts. This also makes `jQuery.getScript` not trigger CSP errors
as it uses the AJAX script transport under the hood.
For sync requests such a change is impossible and that's what `jQuery._evalUrl`
uses. Fixing that is tracked in gh-1895.
The commit also makes other type of requests using the script tag version of the
script transport set its type to "GET", namely async scripts & ones with
`scriptAttrs` set in addition to the existing cross-domain ones.
Fixes gh-3969
Closes gh-47631 parent 82b87f6 commit 07a8e4aCopy full SHA for 07a8e4a
File tree
Expand file treeCollapse file tree
7 files changed
+81
-9
lines changedFilter options
- src/ajax
- test
- data
- unit
Expand file treeCollapse file tree
7 files changed
+81
-9
lines changedCollapse file: src/ajax/script.js
+7-3Lines changed: 7 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 |
| |
37 | 40 |
| |
38 | 41 |
| |
39 | 42 |
| |
40 | 43 |
| |
41 | 44 |
| |
42 | 45 |
| |
43 |
| - | |
44 |
| - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 |
| |
46 | 50 |
| |
47 | 51 |
| |
|
Collapse file: test/data/csp-ajax-script-downloaded.js
test/data/csp-ajax-script-downloaded.js
Copy file name to clipboard+1Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + |
Collapse file: test/data/csp-ajax-script.html
test/data/csp-ajax-script.html
Copy file name to clipboard+13Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + |
Collapse file: test/data/csp-ajax-script.js
test/data/csp-ajax-script.js
Copy file name to clipboard+25Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + |
Collapse file: test/data/mock.php
+6-4Lines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
195 | 195 |
| |
196 | 196 |
| |
197 | 197 |
| |
198 |
| - | |
199 |
| - | |
200 | 198 |
| |
201 | 199 |
| |
202 | 200 |
| |
203 | 201 |
| |
204 | 202 |
| |
205 | 203 |
| |
206 |
| - | |
207 |
| - | |
208 | 204 |
| |
209 | 205 |
| |
210 | 206 |
| |
211 | 207 |
| |
212 | 208 |
| |
213 | 209 |
| |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
214 | 216 |
| |
215 | 217 |
| |
216 | 218 |
| |
|
Collapse file: test/middleware-mockserver.js
test/middleware-mockserver.js
Copy file name to clipboardExpand all lines: test/middleware-mockserver.js+9Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
222 | 222 |
| |
223 | 223 |
| |
224 | 224 |
| |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
225 | 234 |
| |
226 | 235 |
| |
227 | 236 |
| |
|
Collapse file: test/unit/ajax.js
+20-2Lines changed: 20 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
89 | 89 |
| |
90 | 90 |
| |
91 | 91 |
| |
92 |
| - | |
| 92 | + | |
93 | 93 |
| |
94 | 94 |
| |
95 | 95 |
| |
96 | 96 |
| |
| 97 | + | |
97 | 98 |
| |
98 | 99 |
| |
99 | 100 |
| |
100 | 101 |
| |
101 | 102 |
| |
102 | 103 |
| |
| 104 | + | |
| 105 | + | |
| 106 | + | |
103 | 107 |
| |
104 | 108 |
| |
105 | 109 |
| |
| |||
1356 | 1360 |
| |
1357 | 1361 |
| |
1358 | 1362 |
| |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
1359 | 1374 |
| |
1360 | 1375 |
| |
1361 | 1376 |
| |
| |||
1369 | 1384 |
| |
1370 | 1385 |
| |
1371 | 1386 |
| |
1372 |
| - | |
| 1387 | + | |
1373 | 1388 |
| |
1374 | 1389 |
| |
1375 | 1390 |
| |
1376 | 1391 |
| |
1377 | 1392 |
| |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
1378 | 1396 |
| |
1379 | 1397 |
| |
1380 | 1398 |
| |
|
You can’t perform that action at this time.
0 commit comments