Deleted Added
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include <nxt_router.h>
7#include <nxt_http.h>
8
9
10static nxt_int_t nxt_http_var_method(nxt_task_t *task, nxt_str_t *str,
11 void *ctx, uint16_t field);
12static nxt_int_t nxt_http_var_request_uri(nxt_task_t *task, nxt_str_t *str,
13 void *ctx, uint16_t field);
14static nxt_int_t nxt_http_var_uri(nxt_task_t *task, nxt_str_t *str, void *ctx,
15 uint16_t field);
16static nxt_int_t nxt_http_var_host(nxt_task_t *task, nxt_str_t *str, void *ctx,
17 uint16_t field);

--- 18 unchanged lines hidden (view full) ---

36static nxt_int_t nxt_http_var_header(nxt_task_t *task, nxt_str_t *str,
37 void *ctx, uint16_t field);
38static nxt_int_t nxt_http_var_cookie(nxt_task_t *task, nxt_str_t *str,
39 void *ctx, uint16_t field);
40
41
42static nxt_var_decl_t nxt_http_vars[] = {
43 {
44 .name = nxt_string("method"),
45 .handler = nxt_http_var_method,
46 }, {
47 .name = nxt_string("request_uri"),
48 .handler = nxt_http_var_request_uri,
49 }, {
50 .name = nxt_string("uri"),
51 .handler = nxt_http_var_uri,

--- 40 unchanged lines hidden (view full) ---

92nxt_int_t
93nxt_http_register_variables(void)
94{
95 return nxt_var_register(nxt_http_vars, nxt_nitems(nxt_http_vars));
96}
97
98
99static nxt_int_t
100nxt_http_var_method(nxt_task_t *task, nxt_str_t *str, void *ctx, uint16_t field)
101{
102 nxt_http_request_t *r;
103
104 r = ctx;
105
106 *str = *r->method;
107

--- 362 unchanged lines hidden ---