Add WebCms
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" >
|
||||
<head>
|
||||
<title>Repo proxy</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//This is a stupid way of parsing a uri
|
||||
//https://gist.github.com/jlong/2428561
|
||||
|
||||
try {
|
||||
|
||||
var parser = document.createElement('a');
|
||||
parser.href = window.location.search.substring(1);
|
||||
|
||||
// This next line may seem redundant but is required to get around a bug in IE
|
||||
// that doesn't set the parser.hostname or parser.protocol correctly for relative URLs.
|
||||
// see https://gist.github.com/jlong/2428561#gistcomment-1461205
|
||||
parser.href = parser.href;
|
||||
|
||||
// => "http:"
|
||||
if (parser.protocol && (parser.protocol.toLowerCase() != "http:" && parser.protocol.toLowerCase() != "https:")) {
|
||||
throw "invalid protocol";
|
||||
};
|
||||
|
||||
// => "example.com"
|
||||
if (!parser.hostname || parser.hostname == "") {
|
||||
throw "invalid hostname";
|
||||
}
|
||||
|
||||
//parser.port; // => "3000"
|
||||
|
||||
// => "/pathname/"
|
||||
if (!parser.pathname || ((parser.pathname.length - parser.pathname.toLowerCase().indexOf("/developer/packages/installer.aspx")) != "/developer/packages/installer.aspx".length))
|
||||
{
|
||||
throw "invalid pathname";
|
||||
}
|
||||
|
||||
// => "?search=test"
|
||||
if (!parser.search || parser.search.toLowerCase().indexOf("?repoguid") != 0) {
|
||||
throw "invalid search";
|
||||
}
|
||||
|
||||
// => "#hash"
|
||||
if (parser.hash && parser.hash != "") {
|
||||
throw "invalid hash";
|
||||
}
|
||||
|
||||
//parser.host; // => "example.com:3000"
|
||||
|
||||
if (!top.right) {
|
||||
throw "invalid document";
|
||||
}
|
||||
|
||||
top.right.document.location = window.location.search.substring(1);
|
||||
|
||||
} catch (e) {
|
||||
alert(e);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user