Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

js access handler works in mix with js content handler

  • Loading branch information...
commit f6686411cb570787eea7e0cd998c8748bf7b3282 1 parent 28b2f61
Peter Leonov authored
Showing with 13 additions and 7 deletions.
  1. +11 −6 js/tests/access.js
  2. +2 −1  nginx.conf
17 js/tests/access.js
View
@@ -13,12 +13,12 @@ NginxTests.access = function (r)
if (rc != Nginx.OK)
return
- t.eq(sr.headersOut.status, 404, 'response status')
-
+ t.eq(sr.headersOut.status, 200, 'response status')
+ t.eq(body, 'lalala', 'response body')
t.done()
}
- r.subrequest('/loopback/run/access-path/?secret', callback)
+ r.subrequest('/loopback/run/access-path?secret', callback)
t.wait(3000)
})
@@ -30,12 +30,12 @@ NginxTests.access = function (r)
if (rc != Nginx.OK)
return
- t.eq(sr.headersOut.status, 404, 'response status')
+ t.eq(sr.headersOut.status, 200, 'response status')
t.done()
}
- r.subrequest('/loopback/run/access-path/', callback)
+ r.subrequest('/loopback/run/access-path', callback)
t.wait(3000)
})
@@ -52,7 +52,7 @@ NginxTests.access = function (r)
t.done()
}
- r.subrequest('/loopback/run/access-path/?blablabla', callback)
+ r.subrequest('/loopback/run/access-path?blablabla', callback)
t.wait(3000)
})
@@ -68,6 +68,11 @@ NginxTests.access = function (r)
return Nginx.OK
}
+NginxTests.accessPath = function (r)
+{
+ r.sendString('lalala')
+}
+
NginxTests.accessCheck = function (r)
{
var args = r.args
3  nginx.conf
View
@@ -101,9 +101,10 @@ http
js 'Handler.run';
}
- location /run/access-path/
+ location /run/access-path
{
js_access 'NginxTests.accessCheck';
+ js 'Handler.run';
}
location = /variable-set
Please sign in to comment.
Something went wrong with that request. Please try again.