Welcome! Log In Create A New Profile

Advanced

Re: [nginx] Added r->schema.

June 08, 2018 04:02AM
On Fri, Jun 08, 2018 at 11:29:05AM +0800, 洪志道 wrote:
> Hi.
>
> diff -r 8e6bb4e6045f src/http/ngx_http_variables.c
> --- a/src/http/ngx_http_variables.c Thu Jun 07 20:04:22 2018 +0300
> +++ b/src/http/ngx_http_variables.c Thu Jun 07 12:20:05 2018 -0400
> @@ -1420,25 +1420,11 @@
> ngx_http_variable_scheme(ngx_http_request_t *r,
> ngx_http_variable_value_t *v, uintptr_t data)
> {
> -#if (NGX_HTTP_SSL)
> -
> - if (r->connection->ssl) {
> - v->len = sizeof("https") - 1;
> - v->valid = 1;
> - v->no_cacheable = 0;
> - v->not_found = 0;
> - v->data = (u_char *) "https";
> -
> - return NGX_OK;
> - }
> -
> -#endif
> -
> - v->len = sizeof("http") - 1;
> v->valid = 1;
> v->no_cacheable = 0;
> v->not_found = 0;
> - v->data = (u_char *) "http";
> + v->len = r->schema.len;
> + v->data = r->schema.data;
>
> return NGX_OK;
> }
>
> Thanks.

A similar patch has already been considered and rejected:
https://trac.nginx.org/nginx/ticket/1549#comment:5

See also https://trac.nginx.org/nginx/ticket/711.
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Added r->schema.

ru@nginx.com 790 June 07, 2018 03:04PM

Re: [nginx] Added r->schema.

karton 406 June 07, 2018 11:30PM

Re: [nginx] Added r->schema.

ru@nginx.com 523 June 08, 2018 04:02AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 123
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready