@@ -14,22 +14,22 @@ typedef struct {
14
14
#if (NGX_PCRE )
15
15
ngx_regex_t * regex ;
16
16
#endif
17
- } ngx_http_allow_method_loc_conf_t ;
17
+ } ngx_http_allow_methods_loc_conf_t ;
18
18
19
19
20
- static ngx_int_t ngx_http_allow_method_handler (ngx_http_request_t * r );
20
+ static ngx_int_t ngx_http_allow_methods_handler (ngx_http_request_t * r );
21
21
22
- static void * ngx_http_allow_method_create_loc_conf (ngx_conf_t * cf );
23
- static char * ngx_http_allow_method_merge_loc_conf (ngx_conf_t * cf , void * parent , void * child );
24
- static char * ngx_http_allow_method_set_allow_methods (ngx_conf_t * cf , ngx_command_t * cmd , void * conf );
25
- static ngx_int_t ngx_http_allow_method_init (ngx_conf_t * cf );
22
+ static void * ngx_http_allow_methods_create_loc_conf (ngx_conf_t * cf );
23
+ static char * ngx_http_allow_methods_merge_loc_conf (ngx_conf_t * cf , void * parent , void * child );
24
+ static char * ngx_http_allow_methods_set_allow_methods (ngx_conf_t * cf , ngx_command_t * cmd , void * conf );
25
+ static ngx_int_t ngx_http_allow_methods_init (ngx_conf_t * cf );
26
26
27
27
28
- static ngx_command_t ngx_http_allow_method_commands [] = {
28
+ static ngx_command_t ngx_http_allow_methods_commands [] = {
29
29
30
30
{ ngx_string ("allow_methods" ),
31
31
NGX_HTTP_MAIN_CONF |NGX_HTTP_SRV_CONF |NGX_HTTP_LOC_CONF |NGX_HTTP_LIF_CONF |NGX_CONF_1MORE ,
32
- ngx_http_allow_method_set_allow_methods ,
32
+ ngx_http_allow_methods_set_allow_methods ,
33
33
NGX_HTTP_LOC_CONF_OFFSET ,
34
34
0 ,
35
35
NULL },
@@ -38,11 +38,11 @@ static ngx_command_t ngx_http_allow_method_commands[] = {
38
38
};
39
39
40
40
static char *
41
- ngx_http_allow_method_set_allow_methods (ngx_conf_t * cf , ngx_command_t * cmd , void * conf )
41
+ ngx_http_allow_methods_set_allow_methods (ngx_conf_t * cf , ngx_command_t * cmd , void * conf )
42
42
{
43
43
#if (NGX_PCRE )
44
44
45
- ngx_http_allow_method_loc_conf_t * clcf = conf ;
45
+ ngx_http_allow_methods_loc_conf_t * clcf = conf ;
46
46
47
47
ngx_str_t * value ;
48
48
ngx_regex_compile_t rc ;
@@ -77,25 +77,25 @@ ngx_http_allow_method_set_allow_methods(ngx_conf_t *cf, ngx_command_t *cmd, void
77
77
#endif
78
78
}
79
79
80
- static ngx_http_module_t ngx_http_allow_method_module_ctx = {
80
+ static ngx_http_module_t ngx_http_allow_methods_module_ctx = {
81
81
NULL , /* preconfiguration */
82
- ngx_http_allow_method_init , /* postconfiguration */
82
+ ngx_http_allow_methods_init , /* postconfiguration */
83
83
84
84
NULL , /* create main configuration */
85
85
NULL , /* init main configuration */
86
86
87
87
NULL , /* create server configuration */
88
88
NULL , /* merge server configuration */
89
89
90
- ngx_http_allow_method_create_loc_conf , /* create location configuration */
91
- ngx_http_allow_method_merge_loc_conf /* merge location configuration */
90
+ ngx_http_allow_methods_create_loc_conf , /* create location configuration */
91
+ ngx_http_allow_methods_merge_loc_conf /* merge location configuration */
92
92
};
93
93
94
94
95
- ngx_module_t ngx_http_allow_method_module = {
95
+ ngx_module_t ngx_http_allow_methods_module = {
96
96
NGX_MODULE_V1 ,
97
- & ngx_http_allow_method_module_ctx , /* module context */
98
- ngx_http_allow_method_commands , /* module directives */
97
+ & ngx_http_allow_methods_module_ctx , /* module context */
98
+ ngx_http_allow_methods_commands , /* module directives */
99
99
NGX_HTTP_MODULE , /* module type */
100
100
NULL , /* init master */
101
101
NULL , /* init module */
@@ -109,17 +109,17 @@ ngx_module_t ngx_http_allow_method_module = {
109
109
110
110
111
111
static ngx_int_t
112
- ngx_http_allow_method_handler (ngx_http_request_t * r )
112
+ ngx_http_allow_methods_handler (ngx_http_request_t * r )
113
113
{
114
114
#if (NGX_PCRE )
115
115
ngx_int_t rc ;
116
- ngx_http_allow_method_loc_conf_t * clcf ;
116
+ ngx_http_allow_methods_loc_conf_t * clcf ;
117
117
int captures [1 ];
118
118
119
119
ngx_log_debug0 (NGX_LOG_DEBUG_HTTP , r -> connection -> log , 0 ,
120
- "http allow_method handler" );
120
+ "http allow_methods handler" );
121
121
122
- clcf = ngx_http_get_module_loc_conf (r , ngx_http_allow_method_module );
122
+ clcf = ngx_http_get_module_loc_conf (r , ngx_http_allow_methods_module );
123
123
124
124
if (clcf -> regex == NULL ) {
125
125
return NGX_DECLINED ;
@@ -132,7 +132,7 @@ ngx_http_allow_method_handler(ngx_http_request_t *r)
132
132
}
133
133
134
134
ngx_log_debug2 (NGX_LOG_DEBUG_HTTP , r -> connection -> log , 0 ,
135
- "http allow_method faking request method as POST (%d -> %d)" , r -> method , NGX_HTTP_UNKNOWN_BUT_ALLOWED );
135
+ "http allow_methods faking request method as POST (%d -> %d)" , r -> method , NGX_HTTP_UNKNOWN_BUT_ALLOWED );
136
136
137
137
r -> method = NGX_HTTP_UNKNOWN_BUT_ALLOWED ;
138
138
@@ -143,11 +143,11 @@ ngx_http_allow_method_handler(ngx_http_request_t *r)
143
143
144
144
145
145
static void *
146
- ngx_http_allow_method_create_loc_conf (ngx_conf_t * cf )
146
+ ngx_http_allow_methods_create_loc_conf (ngx_conf_t * cf )
147
147
{
148
- ngx_http_allow_method_loc_conf_t * conf ;
148
+ ngx_http_allow_methods_loc_conf_t * conf ;
149
149
150
- conf = ngx_pcalloc (cf -> pool , sizeof (ngx_http_allow_method_loc_conf_t ));
150
+ conf = ngx_pcalloc (cf -> pool , sizeof (ngx_http_allow_methods_loc_conf_t ));
151
151
if (conf == NULL ) {
152
152
return NULL ;
153
153
}
@@ -169,10 +169,10 @@ ngx_http_allow_method_create_loc_conf(ngx_conf_t *cf)
169
169
170
170
171
171
static char *
172
- ngx_http_allow_method_merge_loc_conf (ngx_conf_t * cf , void * parent , void * child )
172
+ ngx_http_allow_methods_merge_loc_conf (ngx_conf_t * cf , void * parent , void * child )
173
173
{
174
- ngx_http_allow_method_loc_conf_t * prev = parent ;
175
- ngx_http_allow_method_loc_conf_t * conf = child ;
174
+ ngx_http_allow_methods_loc_conf_t * prev = parent ;
175
+ ngx_http_allow_methods_loc_conf_t * conf = child ;
176
176
177
177
#if (NGX_PCRE )
178
178
if (conf -> regex == NULL ) {
@@ -196,7 +196,7 @@ ngx_http_allow_method_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
196
196
197
197
198
198
static ngx_int_t
199
- ngx_http_allow_method_init (ngx_conf_t * cf )
199
+ ngx_http_allow_methods_init (ngx_conf_t * cf )
200
200
{
201
201
ngx_http_handler_pt * h ;
202
202
ngx_http_core_main_conf_t * cmcf ;
@@ -208,7 +208,7 @@ ngx_http_allow_method_init(ngx_conf_t *cf)
208
208
return NGX_ERROR ;
209
209
}
210
210
211
- * h = ngx_http_allow_method_handler ;
211
+ * h = ngx_http_allow_methods_handler ;
212
212
213
213
return NGX_OK ;
214
214
}
0 commit comments