Remove whitespaces from $args

Hi,
Tell me please, how can I remove all spaces from $args ?

I create solution, it remove up to 5 spaces. But it not best way i
think.

        if ($args ~ (.*)\s(.*)$) { set $args $1$2; }
        if ($args ~ (.*)\s(.*)$) { set $args $1$2; }
        if ($args ~ (.*)\s(.*)$) { set $args $1$2; }
        if ($args ~ (.*)\s(.*)$) { set $args $1$2; }
        if ($args ~ (.*)\s(.*)$) { set $args $1; }

Posted at Nginx Forum:
https://forum.nginx.org/read.php?2,266482,266482#msg-266482

On Thu, Apr 28, 2016 at 06:46:11AM -0400, Hett wrote:

Hi there,

Tell me please, how can I remove all spaces from $args ?

I suspect that you may need to use one of the programming language
modules available in your nginx to do that.

Why do you want to do it?

Perhaps there is an alternative acceptable way to achieve your final
desired result.

f

Francis D. [email protected]

Hi,
I using third-party software,
in some cases users create not valid url, and I want to fix it
for example:
http://xx.yy/xx/yy/?a=1&b=1 2 3.txt
need replace by:
http://xx.yy/xx/yy/?a=1&b=123.txt

Posted at Nginx Forum:
https://forum.nginx.org/read.php?2,266482,266511#msg-266511

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs