File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 3
3
4
4
BUILTIN_VARIABLES = {
5
5
# http://nginx.org/en/docs/http/ngx_http_core_module.html#var_uri
6
- 'uri' : '/[^\x20 \t ]*' ,
6
+ 'uri' : r '/[^\x20\t]*' ,
7
7
# http://nginx.org/en/docs/http/ngx_http_core_module.html#var_document_uri
8
- 'document_uri' : '/[^\x20 \t ]*' ,
8
+ 'document_uri' : r '/[^\x20\t]*' ,
9
9
# http://nginx.org/en/docs/http/ngx_http_core_module.html#var_arg_
10
- 'arg_' : '[^\s&]+' ,
10
+ 'arg_' : r '[^\s&]+' ,
11
11
# http://nginx.org/en/docs/http/ngx_http_core_module.html#var_args
12
- 'args' : '[^\s]+' ,
12
+ 'args' : r '[^\s]+' ,
13
13
# http://nginx.org/en/docs/http/ngx_http_core_module.html#var_query_string
14
- 'query_string' : '[^\s]+' ,
14
+ 'query_string' : r '[^\s]+' ,
15
15
# http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_uri
16
- 'request_uri' : '/[^\s]*' ,
16
+ 'request_uri' : r '/[^\s]*' ,
17
17
# http://nginx.org/en/docs/http/ngx_http_core_module.html#var_http_
18
- 'http_' : '[\x21 -\x7e ]' ,
18
+ 'http_' : r '[\x21-\x7e]' ,
19
19
20
20
# http://nginx.org/en/docs/http/ngx_http_upstream_module.html#var_upstream_http_
21
21
'upstream_http_' : '' ,
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ def variables(self):
115
115
class RewriteDirective (Directive ):
116
116
nginx_name = 'rewrite'
117
117
provide_variables = True
118
- boundary = Regexp ('[^\s\r \n ]' )
118
+ boundary = Regexp (r '[^\s\r\n]' )
119
119
120
120
def __init__ (self , name , args ):
121
121
super (RewriteDirective , self ).__init__ (name , args )
Original file line number Diff line number Diff line change 4
4
5
5
6
6
class http_splitting (Plugin ):
7
- """
7
+ r """
8
8
Insecure examples:
9
9
rewrite ^ http://$host$uri;
10
10
return 301 http://$host$uri;
Original file line number Diff line number Diff line change 8
8
9
9
10
10
class origins (Plugin ):
11
- """
11
+ r """
12
12
Insecure example:
13
13
if ($http_referer !~ "^https?://([^/]+metrika.*yandex\.ru/"){
14
14
add_header X-Frame-Options SAMEORIGIN;
@@ -29,7 +29,7 @@ def __init__(self, config):
29
29
if self .config .get ('domains' ) and self .config .get ('domains' )[0 ] and self .config .get ('domains' )[0 ] != '*' :
30
30
domains = '|' .join (re .escape (d ) for d in self .config .get ('domains' ))
31
31
else :
32
- domains = '[^/.]*\.[^/]{2,7}'
32
+ domains = r '[^/.]*\.[^/]{2,7}'
33
33
34
34
scheme = 'https{http}' .format (http = ('?' if not self .config .get ('https_only' ) else '' ))
35
35
regex = r'^{scheme}://(?:[^/.]*\.){{0,10}}(?P<domain>{domains})(?::\d*)?(?:/|\?|$)' .format (
You can’t perform that action at this time.
0 commit comments