diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/xhr/send-authentication-basic-repeat-no-args.htm | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/xhr/send-authentication-basic-repeat-no-args.htm')
-rw-r--r-- | testing/web-platform/tests/xhr/send-authentication-basic-repeat-no-args.htm | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/testing/web-platform/tests/xhr/send-authentication-basic-repeat-no-args.htm b/testing/web-platform/tests/xhr/send-authentication-basic-repeat-no-args.htm new file mode 100644 index 0000000000..38f1b20700 --- /dev/null +++ b/testing/web-platform/tests/xhr/send-authentication-basic-repeat-no-args.htm @@ -0,0 +1,33 @@ +<!doctype html> +<html> + <head> + <title>XMLHttpRequest: send() - "Basic" authenticated requests with user name and password passed to open() in first request, without in second</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/common/utils.js"></script> + <link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::ol[1]/li[9]/ol[1]/li[1] following::ol[1]/li[9]/ol[1]/li[2]" /> + <link rel="help" href="https://xhr.spec.whatwg.org/#the-send()-method" data-tested-assertations="following::code[contains(@title,'http-authorization')]/.." /> + </head> + <body> + <div id="log"></div> + <script> + test(function() { + var client = new XMLHttpRequest(), + urlstart = location.host + location.pathname.replace(/\/[^\/]*$/, '/'), + user = token() + client.open("GET", location.protocol+'//'+urlstart + "resources/auth11/auth.py", false, user, 'pass') + client.setRequestHeader("x-user", user) + client.send(null) + // Repeat request but *without* credentials in the open() call. + // Is the UA supposed to cache credentials from above request and use them? Yes. + client.open("GET", location.protocol+'//'+urlstart + "resources/auth11/auth.py", false) + client.setRequestHeader("x-user", user) + client.send(null) + + assert_equals(client.responseText, user + "\n" + 'pass') + //assert_equals(client.getResponseHeader('x-challenge'), 'DID-NOT') + + }, document.title) + </script> + </body> +</html> |