Permalink
Browse files

added another config style for basicauth

  • Loading branch information...
1 parent 5d1c7ab commit a1514e2eaf504029177c815f6dd22f2bf542be81 roberto@precise64 committed Feb 12, 2012
Showing with 7 additions and 1 deletion.
  1. +1 −1 plugins/router_basicauth/router_basicauth.c
  2. +6 −0 protected.ini
@@ -139,7 +139,7 @@ int uwsgi_routing_func_basicauth(struct wsgi_request *wsgi_req, struct uwsgi_rou
}
// chec for "Basic =" string at least
- if (wsgi_req->authorization_len > 7) {
+ if (wsgi_req->authorization_len > 7 && ur->data2_len > 0) {
if (strncmp(wsgi_req->authorization, "Basic ", 6))
goto forbidden;
View
@@ -2,12 +2,18 @@
http-socket = :9090
+route = ^/foo basicauth:foobar,kratos:
+
; a simple user:passowrd mapping
route = .* basicauth:nether realm 3,serena:alessandro
; htpasswd-like real-time parsing
route = .* basicauth:nether realm 2,.htpasswd
; user-only auth
route = .* basicauth:nether realm 4,roberta:
+route = .* basicauth:nether realm 4,
+
+route = ^/bar basicauth:foobar,kratos:
+
module = welcome

0 comments on commit a1514e2

Please sign in to comment.