diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /browser/base/content/test/referrer/file_referrer_policyserver.sjs | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'browser/base/content/test/referrer/file_referrer_policyserver.sjs')
-rw-r--r-- | browser/base/content/test/referrer/file_referrer_policyserver.sjs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/browser/base/content/test/referrer/file_referrer_policyserver.sjs b/browser/base/content/test/referrer/file_referrer_policyserver.sjs new file mode 100644 index 000000000..e07965675 --- /dev/null +++ b/browser/base/content/test/referrer/file_referrer_policyserver.sjs @@ -0,0 +1,37 @@ +/** + * Renders a link with the provided referrer policy. + * Used in browser_referrer_*.js, bug 1113431. + * Arguments: ?scheme=http://&policy=origin&rel=noreferrer + */ +function handleRequest(request, response) +{ + Components.utils.importGlobalProperties(["URLSearchParams"]); + let query = new URLSearchParams(request.queryString); + + let scheme = query.get("scheme"); + let policy = query.get("policy"); + let rel = query.get("rel"); + + let linkUrl = scheme + + "test1.example.com/browser/browser/base/content/test/referrer/" + + "file_referrer_testserver.sjs"; + let metaReferrerTag = + policy ? `<meta name='referrer' content='${policy}'>` : ""; + + let html = `<!DOCTYPE HTML> + <html> + <head> + <meta charset='utf-8'> + ${metaReferrerTag} + <title>Test referrer</title> + </head> + <body> + <a id='testlink' href='${linkUrl}' ${rel ? ` rel='${rel}'` : ""}> + referrer test link</a> + </body> + </html>`; + + response.setHeader("Cache-Control", "no-cache", false); + response.setHeader("Content-Type", "text/html", false); + response.write(html); +} |