Goal
Test for discrepancy between a URL's parsed components as they appear in the DOM properties versus an HTTP GET request.
Description
This page tests how a URL's properties compare in the DOM and an HTTP GET request, using the following method:
- Load test cases from urls-local.json
- For each test case, create an iframe in the same origin as the parent document.
- In the iframe, create an anchor element with the test case as href, e.g.:
<a href="http://urltest.lookout.net/foo?bar"></a>
In the iframe reate a script element with the test case as src, e.g.:
<script src="http://urltest.lookout.net/foo?bar"></script>
This host is setup with a wildcard DNS record, a mod_rewrite rule, and a CGI script so that any request that includes "urltest" in the hostname will return a javascript document with two variables: "hostname" and "pathname" with values taken from the HTTP GET request.
Compare the DOM properties of the anchor's href, with the two javascript variables returned from the HTTP GET request.