Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DLNA-RUI
cvp2ts
Commits
d888bb25
Commit
d888bb25
authored
Oct 21, 2014
by
Glenn Adams
Browse files
Update https, tls, wsp configuration.
parent
bde60396
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
specs/https/helpers/SchemeHTTPS.js
0 → 100644
View file @
d888bb25
"
use strict
"
;
function
run
(
t
)
{
var
defProperties
=
t
.
properties
.
def
;
var
url
=
'
./support/respond.py
'
;
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'
GET
'
,
url
,
true
);
xhr
.
onload
=
t
.
step_func_done
(
function
()
{
// test original request headers (returned unmodified by responder)
var
response
=
JSON
.
parse
(
xhr
.
response
);
test
(
function
()
{
assert_true
(
'
accept
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-accept-present
'
);
test
(
function
()
{
assert_true
(
'
accept-language
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-accept-language-present
'
);
test
(
function
()
{
assert_true
(
'
accept-encoding
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-accept-encoding-present
'
);
test
(
function
()
{
assert_true
(
'
connection
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-connection-present
'
);
test
(
function
()
{
assert_equals
(
response
[
'
connection
'
],
'
keep-alive
'
);
},
defProperties
.
expandedName
+
'
-test-request-header-connection-has-keep-alive
'
);
test
(
function
()
{
assert_true
(
'
host
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-host-present
'
);
test
(
function
()
{
assert_equals
(
response
[
'
host
'
],
location
.
host
);
},
defProperties
.
expandedName
+
'
-test-request-header-host-match
'
);
test
(
function
()
{
assert_true
(
'
referer
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-referer-present
'
);
test
(
function
()
{
assert_equals
(
response
[
'
referer
'
],
location
.
href
);
},
defProperties
.
expandedName
+
'
-test-request-header-referer-match
'
);
test
(
function
()
{
assert_true
(
'
user-agent
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-user-agent-present
'
);
// test response headers (returned by responder)
var
responseHeaders
=
getResponseHeaders
(
xhr
);
test
(
function
()
{
assert_true
(
'
content-length
'
in
responseHeaders
);
},
defProperties
.
expandedName
+
'
-test-response-header-content-length-present
'
);
test
(
function
()
{
assert_true
(
'
content-type
'
in
responseHeaders
);
},
defProperties
.
expandedName
+
'
-test-response-header-content-type-present
'
);
test
(
function
()
{
assert_equals
(
responseHeaders
[
'
content-type
'
],
'
application/json
'
);
},
defProperties
.
expandedName
+
'
-test-response-header-content-type-match
'
);
test
(
function
()
{
assert_true
(
'
date
'
in
responseHeaders
);
},
defProperties
.
expandedName
+
'
-test-response-header-date-present
'
);
test
(
function
()
{
assert_true
(
'
server
'
in
responseHeaders
);
},
defProperties
.
expandedName
+
'
-test-response-header-server-present
'
);
});
xhr
.
onerror
=
function
()
{
assert_unreached
(
'
unable to load
'
+
url
);
};
xhr
.
send
();
}
function
getResponseHeaders
(
xhr
)
{
var
headers
=
xhr
.
getAllResponseHeaders
().
split
(
'
\
u000d
\
u000a
'
);
var
responseHeaders
=
{};
for
(
var
i
=
0
;
i
<
headers
.
length
;
++
i
)
{
var
header
=
headers
[
i
];
if
(
header
.
indexOf
(
'
:
'
)
>=
0
)
{
var
headerComponents
=
header
.
split
(
'
:
'
);
var
n
=
headerComponents
[
0
];
var
v
=
headerComponents
[
1
];
responseHeaders
[
n
.
toLowerCase
().
trim
()]
=
v
.
trim
();
}
}
return
responseHeaders
;
}
specs/https/https.config.json
View file @
d888bb25
{
"spec"
:
"https"
,
"source"
:
"http://tools.ietf.org/rfc/rfc
5785
.txt"
,
"source"
:
"http://tools.ietf.org/rfc/rfc
2616
.txt"
,
"levels"
:
[
3
],
"local"
:
"rfc
5785
.txt"
,
"local"
:
"rfc
2616
.txt"
,
"dontFetch"
:
true
,
"dontFetchReason"
:
"specification is final"
,
"comments"
:
"can't test yet due to missing tls support in wptserve"
,
"helpers3"
:
[]
}
specs/https/support/respond.py
0 → 100644
View file @
d888bb25
import
json
def
main
(
request
,
response
):
response
.
headers
.
set
(
"Content-Type"
,
"application/json"
)
return
json
.
dumps
(
request
.
headers
)
specs/index/index.idl.json
View file @
d888bb25
This diff is collapsed.
Click to expand it.
specs/tls/tls.config.json
View file @
d888bb25
...
...
@@ -5,5 +5,6 @@
"local"
:
"rfc5246.txt"
,
"dontFetch"
:
true
,
"dontFetchReason"
:
"specification is final"
,
"comments"
:
"can't test yet due to missing tls support in wptserve"
,
"helpers3"
:
[]
}
specs/wsp/rfc6455.txt
0 → 100644
View file @
d888bb25
This diff is collapsed.
Click to expand it.
specs/wsp/wsp.config.json
View file @
d888bb25
...
...
@@ -5,5 +5,16 @@
"local"
:
"rfc6455.txt"
,
"dontFetch"
:
true
,
"dontFetchReason"
:
"specification is final"
,
"helpers3"
:
[]
"comments"
:
"can't test 'wss' scheme yet due to missing tls support in pywebsocket"
,
"helpers3"
:
[
"SchemeWS"
],
"tests"
:
[
{
"name"
:
"SchemeWS"
,
"helper"
:
"SchemeWS"
,
"code"
:
"run(t)"
,
"async"
:
true
}
]
}
tests/https/helpers/SchemeHTTPS.js
0 → 100644
View file @
d888bb25
"
use strict
"
;
function
run
(
t
)
{
var
defProperties
=
t
.
properties
.
def
;
var
url
=
'
./support/respond.py
'
;
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'
GET
'
,
url
,
true
);
xhr
.
onload
=
t
.
step_func_done
(
function
()
{
// test original request headers (returned unmodified by responder)
var
response
=
JSON
.
parse
(
xhr
.
response
);
test
(
function
()
{
assert_true
(
'
accept
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-accept-present
'
);
test
(
function
()
{
assert_true
(
'
accept-language
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-accept-language-present
'
);
test
(
function
()
{
assert_true
(
'
accept-encoding
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-accept-encoding-present
'
);
test
(
function
()
{
assert_true
(
'
connection
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-connection-present
'
);
test
(
function
()
{
assert_equals
(
response
[
'
connection
'
],
'
keep-alive
'
);
},
defProperties
.
expandedName
+
'
-test-request-header-connection-has-keep-alive
'
);
test
(
function
()
{
assert_true
(
'
host
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-host-present
'
);
test
(
function
()
{
assert_equals
(
response
[
'
host
'
],
location
.
host
);
},
defProperties
.
expandedName
+
'
-test-request-header-host-match
'
);
test
(
function
()
{
assert_true
(
'
referer
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-referer-present
'
);
test
(
function
()
{
assert_equals
(
response
[
'
referer
'
],
location
.
href
);
},
defProperties
.
expandedName
+
'
-test-request-header-referer-match
'
);
test
(
function
()
{
assert_true
(
'
user-agent
'
in
response
);
},
defProperties
.
expandedName
+
'
-test-request-header-user-agent-present
'
);
// test response headers (returned by responder)
var
responseHeaders
=
getResponseHeaders
(
xhr
);
test
(
function
()
{
assert_true
(
'
content-length
'
in
responseHeaders
);
},
defProperties
.
expandedName
+
'
-test-response-header-content-length-present
'
);
test
(
function
()
{
assert_true
(
'
content-type
'
in
responseHeaders
);
},
defProperties
.
expandedName
+
'
-test-response-header-content-type-present
'
);
test
(
function
()
{
assert_equals
(
responseHeaders
[
'
content-type
'
],
'
application/json
'
);
},
defProperties
.
expandedName
+
'
-test-response-header-content-type-match
'
);
test
(
function
()
{
assert_true
(
'
date
'
in
responseHeaders
);
},
defProperties
.
expandedName
+
'
-test-response-header-date-present
'
);
test
(
function
()
{
assert_true
(
'
server
'
in
responseHeaders
);
},
defProperties
.
expandedName
+
'
-test-response-header-server-present
'
);
});
xhr
.
onerror
=
function
()
{
assert_unreached
(
'
unable to load
'
+
url
);
};
xhr
.
send
();
}
function
getResponseHeaders
(
xhr
)
{
var
headers
=
xhr
.
getAllResponseHeaders
().
split
(
'
\
u000d
\
u000a
'
);
var
responseHeaders
=
{};
for
(
var
i
=
0
;
i
<
headers
.
length
;
++
i
)
{
var
header
=
headers
[
i
];
if
(
header
.
indexOf
(
'
:
'
)
>=
0
)
{
var
headerComponents
=
header
.
split
(
'
:
'
);
var
n
=
headerComponents
[
0
];
var
v
=
headerComponents
[
1
];
responseHeaders
[
n
.
toLowerCase
().
trim
()]
=
v
.
trim
();
}
}
return
responseHeaders
;
}
tests/https/support/respond.py
0 → 100644
View file @
d888bb25
import
json
def
main
(
request
,
response
):
response
.
headers
.
set
(
"Content-Type"
,
"application/json"
)
return
json
.
dumps
(
request
.
headers
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment