Welcome! Log In Create A New Profile

Advanced

Re: njs: get raw requestURI or full querystring

Dmitry Volyntsev
April 28, 2021 09:18AM
On 28.04.2021 16:12, Gunter Grodotzki wrote:
> sadly the whole object is empty. no key / no value.
>
>
Try the following variable

http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_uri

decodeURIComponent(r.variables.request_uri.split('?')[1])


in njs CLI

>>
decodeURIComponent("https://url.rw/?https%3A%2F%2Flifeofguenter.de".split('?')[1])
'https://lifeofguenter.de'

>> On 28 Apr 2021, at 14:17, Sergey A. Osokin <osa@freebsd.org.ru> wrote:
>>
>> ´╗┐On Wed, Apr 28, 2021 at 07:45:37AM +0200, Gunter Grodotzki wrote:
>>> Unfortunately r.args is empty if no key/value pair is given.
>> Well, the r.args is empty in case of an emptyness of a querystring.
>>
>> But we have a bit different case when URL contains a query
>> string with a key, but without a value for that one,
>> i.e. "https://url.rw/?https%3A%2F%2Flifeofguenter.de".
>>
>> So, the "https%3A%2F%2Flifeofguenter.de" is the key and its value
>> is empty.
>>
>> --
>> Sergey Osokin
>> _______________________________________________
>> nginx-devel mailing list
>> nginx-devel@nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx-devel
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

njs: get raw requestURI or full querystring

Gunter Grodotzki 149 April 27, 2021 05:22PM

Re: njs: get raw requestURI or full querystring

Sergey A. Osokin 32 April 27, 2021 10:52PM

Re: njs: get raw requestURI or full querystring

Gunter Grodotzki 21 April 28, 2021 01:46AM

Re: njs: get raw requestURI or full querystring

Sergey A. Osokin 29 April 28, 2021 08:18AM

Re: njs: get raw requestURI or full querystring

Gunter Grodotzki 21 April 28, 2021 09:14AM

Re: njs: get raw requestURI or full querystring

Dmitry Volyntsev 23 April 28, 2021 09:18AM

RE: njs: get raw requestURI or full querystring

Gunter Grodotzki 42 April 28, 2021 10:44AM



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

Online Users

Guests: 74
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready