Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 1107:db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 14 Feb 2007 18:51:19 +0000 |
parents | 4d203f76b757 |
children | 3a95870b3229 |
comparison
equal
deleted
inserted
replaced
1106:2c7fed12fab7 | 1107:db7c468c447d |
---|---|
10 #include <ngx_http.h> | 10 #include <ngx_http.h> |
11 #include <nginx.h> | 11 #include <nginx.h> |
12 | 12 |
13 | 13 |
14 typedef struct { | 14 typedef struct { |
15 char *name; | 15 u_char *name; |
16 uint32_t method; | 16 uint32_t method; |
17 } ngx_http_method_name_t; | 17 } ngx_http_method_name_t; |
18 | 18 |
19 | 19 |
20 #define NGX_HTTP_LOCATION_EXACT 1 | 20 #define NGX_HTTP_LOCATION_EXACT 1 |
1245 } | 1245 } |
1246 | 1246 |
1247 encoded = r->headers_in.authorization->value; | 1247 encoded = r->headers_in.authorization->value; |
1248 | 1248 |
1249 if (encoded.len < sizeof("Basic ") - 1 | 1249 if (encoded.len < sizeof("Basic ") - 1 |
1250 || ngx_strncasecmp(encoded.data, "Basic ", sizeof("Basic ") - 1) != 0) | 1250 || ngx_strncasecmp(encoded.data, (u_char *) "Basic ", |
1251 sizeof("Basic ") - 1) | |
1252 != 0) | |
1251 { | 1253 { |
1252 r->headers_in.user.data = (u_char *) ""; | 1254 r->headers_in.user.data = (u_char *) ""; |
1253 return NGX_DECLINED; | 1255 return NGX_DECLINED; |
1254 } | 1256 } |
1255 | 1257 |
2679 return NGX_CONF_OK; | 2681 return NGX_CONF_OK; |
2680 } | 2682 } |
2681 | 2683 |
2682 | 2684 |
2683 static ngx_http_method_name_t ngx_methods_names[] = { | 2685 static ngx_http_method_name_t ngx_methods_names[] = { |
2684 { "GET", (uint32_t) ~NGX_HTTP_GET }, | 2686 { (u_char *) "GET", (uint32_t) ~NGX_HTTP_GET }, |
2685 { "HEAD", (uint32_t) ~NGX_HTTP_HEAD }, | 2687 { (u_char *) "HEAD", (uint32_t) ~NGX_HTTP_HEAD }, |
2686 { "POST", (uint32_t) ~NGX_HTTP_POST }, | 2688 { (u_char *) "POST", (uint32_t) ~NGX_HTTP_POST }, |
2687 { "PUT", (uint32_t) ~NGX_HTTP_PUT }, | 2689 { (u_char *) "PUT", (uint32_t) ~NGX_HTTP_PUT }, |
2688 { "DELETE", (uint32_t) ~NGX_HTTP_DELETE }, | 2690 { (u_char *) "DELETE", (uint32_t) ~NGX_HTTP_DELETE }, |
2689 { "MKCOL", (uint32_t) ~NGX_HTTP_MKCOL }, | 2691 { (u_char *) "MKCOL", (uint32_t) ~NGX_HTTP_MKCOL }, |
2690 { "COPY", (uint32_t) ~NGX_HTTP_COPY }, | 2692 { (u_char *) "COPY", (uint32_t) ~NGX_HTTP_COPY }, |
2691 { "MOVE", (uint32_t) ~NGX_HTTP_MOVE }, | 2693 { (u_char *) "MOVE", (uint32_t) ~NGX_HTTP_MOVE }, |
2692 { "OPTIONS", (uint32_t) ~NGX_HTTP_OPTIONS }, | 2694 { (u_char *) "OPTIONS", (uint32_t) ~NGX_HTTP_OPTIONS }, |
2693 { "PROPFIND" , (uint32_t) ~NGX_HTTP_PROPFIND }, | 2695 { (u_char *) "PROPFIND" , (uint32_t) ~NGX_HTTP_PROPFIND }, |
2694 { "PROPPATCH", (uint32_t) ~NGX_HTTP_PROPPATCH }, | 2696 { (u_char *) "PROPPATCH", (uint32_t) ~NGX_HTTP_PROPPATCH }, |
2695 { "LOCK", (uint32_t) ~NGX_HTTP_LOCK }, | 2697 { (u_char *) "LOCK", (uint32_t) ~NGX_HTTP_LOCK }, |
2696 { "UNLOCK", (uint32_t) ~NGX_HTTP_UNLOCK }, | 2698 { (u_char *) "UNLOCK", (uint32_t) ~NGX_HTTP_UNLOCK }, |
2697 { NULL, 0 } | 2699 { NULL, 0 } |
2698 }; | 2700 }; |
2699 | 2701 |
2700 | 2702 |
2701 static char * | 2703 static char * |