Lines Matching +full:test +full:-
1 -- http://www.html5rocks.com/static/images/cors_server_flowchart.png
7 mg.write("Content-Type: text/html; charset=utf-8\r\n")
9 mg.write("This test page should not be used directly. Open cors.html instead.")
15 -- Note: This is a test example showing how a script could handle
16 -- a preflight request directly. However, now the server is able
17 -- to handle preflight requests, so scripts do no longer need to
18 -- do this - except it has been disabled in the server by setting
19 -- the access_control_allow_methods configuration parameter to
20 -- an empty string.
22 local acrm = mg.request_info.http_headers['Access-Control-Request-Method'];
24 local acrh = nil -- mg.request_info.http_headers['Access-Control-Request-Header'];
26 -- invalid request
32 -- preflight request
34 mg.write("Access-Control-Allow-Methods: PUT\r\n")
36 mg.write("Access-Control-Allow-Headers: " .. acrh .. "\r\n")
38 mg.write("Access-Control-Allow-Origin: *\r\n")
40 mg.write("Content-Type: text/html; charset=utf-8\r\n")
48 -- actual request
52 mg.write("Access-Control-Allow-Origin: *\r\n")
54 mg.write("Content-Type: text/html; charset=utf-8\r\n")
58 <head><title>CORS dynamic GET test reply - test OK</title></head>
69 mg.write("Access-Control-Allow-Origin: *\r\n")
71 mg.write("Content-Type: text/html; charset=utf-8\r\n")
75 <head><title>CORS dynamic PUT test reply - test OK</title></head>
82 -- other HTTP method