Allow %20 in web2py requests args -


I am trying to get a request to pass the encoded strings into a URL. For example:

  / application / controller / function / hello% 20world   

so that I can use request.args in my function and string I can not get rid of ().

I tried to modify rewrite.py to not convert% 20 but something went wrong with this and catching these requests that I have trouble troublesome. I have seen that in the httpserver.log file:

  127.0.0.1, 2011-09-02 00:12:09, receive / app / controller / function / hello world, http / 1.1, 200, 0.169 9 54   

Location already moved, perhaps indicating where the URL is being transcribed?

Below is the content of my routes:

  #! / Usr / bin / python # - * - coding: UTF-8 - * - default_application = 'chips' default_controller = 'default' default_function = 'index' routes_range = [(r '* / 404', 'r' / chips / Static / 404.html ''), (R '* / *', 'R' / chips / static / error.html '']]    

By default, web2py '@', '-', '=' and '.' Except for special characters in the args will not be allowed to override that behavior, you can add from the following: path_apps_raw = ['chips']

In this case, request. The args will not be set to any , and instead you can access the raw Elg from the URL via request.raw_args . Note, however, that if you are using (code, if your path contains the file router ), then routes_apps_raw does not work.

Note that, along with the above change, the rocket will be included in web server with web2py automatically unquote () urls, so that you request.raw_args

If you are using a parameter-based rearLite system in turn, you can control which letter url arguments in the args_match key , Which is a regular expression of its value The default regex is r '([\ w @ -] | (? & Lt; = [\ w @ -]) [. =]) * $' , which is' @ ',' - 'allows',' = ', and' '(With some restrictions on' = 'and'. ').

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -