[web2py] Re: request.args encoding

2016-07-27 Thread Anthony
Note, if you are confident you can validate the input and won't be subject to the security concerns Massimo mentioned, you can access the original untransformed args via request.raw_args. Note, that is the entire arg string, including the "/" separators (i.e., it is not converted to a list of a

[web2py] Re: request.args encoding

2016-07-27 Thread Massimo Di Pierro
web2py restricts what chars can be in the args to avoid problems. For example # cannot be in the args because it is used to separate the hash. Also often the args are used to access files or other resources and we want to protect against possible insecure direct object reference attacks (https:

[web2py] Re: request.args and special character

2016-05-25 Thread villas
@Ivan Could be caused by the router. See this http://stackoverflow.com/questions/7279198/allow-20-in-web2py-requests-args. I guess you could always use a different encoding too (base64 or something?). Or maybe access request.raw_args @Dave, request.args(0) is similar to request.arg[0] exce

[web2py] Re: request.args and special character

2016-05-24 Thread Dave S
On Tuesday, May 24, 2016 at 1:49:30 PM UTC-7, Ivan Gazzola wrote: > > I've tried an URI like this "app/controller/function/1%C2%B0%20Classe" for > sending the "1° Classe" value > > If in my function i call > > request.args(0) > > I get "1__Classe" > > If I call > > request.url.split('/')[-1] >

[web2py] Re: request.args

2016-01-18 Thread goome
ah ok, tanks a lot Il giorno lunedì 18 gennaio 2016 14:18:49 UTC+1, Anthony ha scritto: > > On Monday, January 18, 2016 at 4:29:56 AM UTC-5, goome wrote: >> >> Thank you! >> It works, but i cannot understnd how and why. >> Could you explain? >> How is grid interested in request.args(if i don't us

[web2py] Re: request.args

2016-01-18 Thread Anthony
On Monday, January 18, 2016 at 4:29:56 AM UTC-5, goome wrote: > > Thank you! > It works, but i cannot understnd how and why. > Could you explain? > How is grid interested in request.args(if i don't use it as such, but copy > args[0] in ufie and pass that to grid)? > The grid creates a number of

[web2py] Re: request.args

2016-01-18 Thread goome
Thank you! It works, but i cannot understnd how and why. Could you explain? How is grid interested in request.args(if i don't use it as such, but copy args[0] in ufie and pass that to grid)? Il giorno lunedì 18 gennaio 2016 02:10:32 UTC+1, Massimo Di Pierro ha scritto: > > should eb > > def vi

[web2py] Re: request.args

2016-01-17 Thread Massimo Di Pierro
should eb def vistaSIMFDB(): ufile=request.args(0) #ufile='SIMFDB_2016011509341800.csv' #form=legacy_db(legacy_db.SIMFDB.filename==ufile).select() form = SQLFORM.grid(legacy_db.SIMFDB.filename==ufile, csv=True, args=request.args[:1] ) return dict(form=form) you have to tell the grid whic

[web2py] Re: request.args

2016-01-17 Thread goome
this is making me mad(i think i am missing somethng obvious, bt i don't know what): This work: def vistaSIMFDB(): ufile=request.args[0] #ufile='SIMFDB_2016011509341800.csv' form=legacy_db(legacy_db.SIMFDB.filename==ufile).select() #form = SQLFORM.grid(legacy_db.SIMFDB.filename==ufile, csv

[web2py] Re: request.args

2016-01-17 Thread Anthony
Is that all you have in routes, because your URL excludes the controller, which would also be implemented via the routes? Also, when you get that error, is the exact URL in the address bar of the browser http://127.0.0.1:8000/PROVE/dettaglio_aggiornamenti/SPE/SPE_2016011518051300.csv

[web2py] Re: request.args

2016-01-17 Thread goome
i have route_in that about this app has : ('/PROVE','/PROVE/default/index') Il giorno domenica 17 gennaio 2016 14:06:51 UTC+1, Niphlod ha scritto: > > are you using routes.py ? > > On Sunday, January 17, 2016 at 11:12:16 AM UTC+1, goome wrote: >> >> i have this url : >> http://127.0.0.1:8000/PROV

[web2py] Re: request.args

2016-01-17 Thread Niphlod
are you using routes.py ? On Sunday, January 17, 2016 at 11:12:16 AM UTC+1, goome wrote: > > i have this url : > http://127.0.0.1:8000/PROVE/dettaglio_aggiornamenti/SPE/SPE_2016011518051300.csv > > generated by: > > href="{{=URL(r=request,f='dettaglio_aggiornamenti',args=['SPE',ultimoFileSpe])}

[web2py] Re: request.args and request.args[-3] == 'view':

2015-11-19 Thread Anthony
if len(request.args) >= 3 and request.args[-3] == 'view': or: if request.args(-3) == 'view': request.args(index) is the same as request.args[index], except the former returns None rather than raising an exception if the index is out of range. Finally, you could just do: if 'view' in request.a

[web2py] Re: request.args return __(double underscore) instead of proper unicode character ??

2015-03-15 Thread Leonel Câmara
You can't. That's not a proper URI, IRI does support that hence why you can type it in the browser. I think this is a bad idea and you should use vars for stuff that needs encoding. Still... you can get the correct arg string if you get a look at raw_args, example Controller: def test():

[web2py] Re: request.args return __(double underscore) instead of proper unicode character ??

2015-03-15 Thread Robin Manoli
This would be nice! Den torsdag 19 februari 2015 kl. 10:20:37 UTC+1 skrev Mirek Zvolský: > > I have problem with unicode characters in url in request.args. > > > Most resources recommend to use the percent encoding. > > http://stackoverflow.com/questions/2742852/unicode-characters-in-urls > > >

[web2py] Re: request.args returns each arg as string

2012-02-14 Thread Annet
Hi Bruno, Thanks for your explanation. Kind regards, Annet.

[web2py] Re: request.args inconsistent behaviour and ignoring URI valid characters

2011-09-06 Thread Massimo Di Pierro
Exactly! This is an importent security feature. On Sep 5, 9:39 pm, pbreit wrote: > It's hard to say exactly what is allowed but according to my reading > ofhttp://tools.ietf.org/html/rfc3986* is definitely not allowed and . and .. > may not be allowed in the path (since they have meaning in a f

[web2py] Re: request.args inconsistent behaviour and ignoring URI valid characters

2011-09-05 Thread Noel Villamor
I see. So that explains the backtracking when two dots are in the URL (similar behaviour to cd .. at the command line).