Quellcodebibliothek
Statistik
Leitseite
products
/
Sources
/
formale Sprachen
/
C
/
Firefox
/
dom
/
security
/
test
/
csp
/ Datei vom 27.6.2026 mit Größe 3 kB
SSL file_upgrade_insecure_meta.html Sprache: HTML
products/Sources/formale Sprachen/C/Firefox/dom/security/test/csp/file_upgrade_insecure_meta.html
<!
DOCTYPE
HTML
>
<
html
>
<
head
>
<
meta
http-equiv=
"Content-Security-Policy"
content=
"upgrade-insecure-requests; defau
lt-src https: wss: 'unsafe-inline'; form-action https:;"
>
<
meta
charset=
"utf-8"
>
<
title
>Bug
1139297
- Implement CSP upgrade-insecure-requests directive</
title
>
<!-- style -->
<
link
rel=
'stylesheet'
type=
'text/css'
href=
'
http://example.com/tests/dom/security/t
est/csp/file_upgrade_insecure_server.sjs?style
'
media=
'screen'
/>
<!-- font -->
<
style
>
@
font
-face {
font
-family:
"foofont"
;
src: url(
'
http://example.com/tests/dom/security/test/csp/file_upgrade_insecure_se
rver.sjs?font
'
);
}
.div_foo {
font
-family:
"foofont"
; }
</
style
>
</
head
>
<
body
>
<!-- images: -->
<
img
src=
"
http://example.com/tests/dom/security/test/csp/file_upgrade_insecure_ser
ver.sjs?img
"
></
img
>
<!-- redirects: upgrade
http:// to
https:// redirect to http:// and then upgrade to https:// ag
ain -->
<
img
src=
"
http://example.com/tests/dom/security/test/csp/file_upgrade_insecure_ser
ver.sjs?redirect-image
"
></
img
>
<!-- script: -->
<
script
src=
"
http://example.com/tests/dom/security/test/csp/file_upgrade_insecure_
server.sjs?script
"
></
script
>
<!-- media: -->
<
audio
src=
"
http://example.com/tests/dom/security/test/csp/file_upgrade_insecure_s
erver.sjs?media
"
></
audio
>
<!-- objects: -->
<
object
width=
"10"
height=
"10"
data=
"
http://example.com/tests/dom/security/test/csp/
file_upgrade_insecure_server.sjs?object
"
></
object
>
<!-- font: (apply font loaded in header to div) -->
<
div
class=
"div_foo"
>foo</
div
>
<!-- iframe: (same origin) -->
<
iframe
src=
"
http://example.com/tests/dom/security/test/csp/file_upgrade_insecure_
server.sjs?iframe
"
>
<!-- within that iframe we load an image over http and make sure the requested gets upgraded to htt
ps -->
</
iframe
>
<!-- xhr: -->
<
script
type=
"application/javascript"
>
var
myXHR = new XMLHttpRequest();
myXHR.open(
"GET"
,
"
http://example.com/tests/dom/security/test/csp/file_upgrade_in
secure_server.sjs?xhr
"
);
myXHR.send(null);
</
script
>
<!-- websockets: upgrade ws:// to wss://-->
<
script
type=
"application/javascript"
>
// WebSocket tests are not supported on Android Yet. Bug
1566168
.
const { AppConstants } = SpecialPowers.ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
if (AppConstants.platform !==
"android"
) {
var
mySocket = new WebSocket(
"ws://example.com/tests/dom/security/test/csp/file_upgr
ade_insecure"
);
mySocket.onopen = function(e) {
if (mySocket.url.includes(
"wss://"
)) {
window.parent.postMessage({result:
"websocket-ok"
},
"*"
);
}
else {
window.parent.postMessage({result:
"websocket-error"
},
"*"
);
}
mySocket.close();
};
mySocket.onerror = function(e) {
window.parent.postMessage({result:
"websocket-unexpected-error"
},
"*"
);
};
}
</
script
>
<!-- form action: (upgrade POST from
http:// to
https://) -->
<
iframe
name=
'formFrame'
id=
'formFrame'
></
iframe
>
<
form
target=
"formFrame"
action=
"
http://example.com/tests/dom/security/test/csp/fil
e_upgrade_insecure_server.sjs?form
"
method=
"POST"
>
<
input
name=
"foo"
value=
"foo"
>
<
input
type=
"submit"
id=
"submitButton"
formenctype=
'multipart/form-data'
value=
"Submi
t form"
>
</
form
>
<
script
type=
"text/javascript"
>
var
submitButton = document.getElementById(
'submitButton'
);
submitButton.click();
</
script
>
</
body
>
</
html
>
Messung
C
H
Z
G
92
100
100
97
¤
Dauer der Verarbeitung: 0.4 Sekunden (vorverarbeitet am 2026-11-25)
¤
*© Formatika GbR, Deutschland
2026-11-25