I double checked and the is_valid_ip_address in trunk is the same as the 
one you have.
I do not know why that fails on dotcloud. You may want to comment these two 
lines in main:

if not is_valid_ip_address(client):
        raise HTTP(400,"Bad Request (request.client=%s)" % client)
   
Not a big deal. I am sorry I do not have a better suggestion. It would be 
nice if you could help debug this by putting some print statements into 
that function and figuring out where it fails to validate the ip address. 

On Thursday, 11 October 2012 06:50:00 UTC-5, curiouslearn wrote:
>
> Hi Massimo,
>
> I think I probably figured what you were saying: Validation passes on 
> localhost, but not on dotcloud because of some problem on their servers.
> Would appreciate if you let me know whether that is a correct 
> interpretation, before I tell them that it is a problem on their side.
>
> On another note, my web2py version shows as up to date on the admin page 
> Version 2.0.9 (2012-09-13 23:51:30) stable
>
> web2py is up to date <http://web2py.com/>
>
> Running on Rocket 1.2.4
>
> Do I need to update to trunk manually? Thank you.
>
>
> On Wednesday, October 10, 2012 10:20:05 PM UTC-4, curiouslearn wrote:
>>
>> Massimo, thanks for the reply. 
>>
>> I would appreciate if you can clarify what I should do since it is not 
>> passing validation on dotcloud. Is this a dotcloud problem and should I 
>> inform them about this.
>>
>> Or, is it a problem with web2py version 2.0.9 (2012-09-13 23:51:30) 
>> stable and should I upgrade to the trunk to solve this?
>>
>> Thank you.
>>
>> On Wednesday, October 10, 2012 10:01:55 PM UTC-4, Massimo Di Pierro wrote:
>>>
>>> This is a security measure. Some buggy web servers pass invalid ip 
>>> addresses and this results in session information leakage. Web2py checks 
>>> this.
>>> In your case it should pass validation. You have an old version and it 
>>> is possible this is already fixed in trunk. 
>>>
>>> Now the validate function is in gluon/utils.py and looking at it now, it 
>>> should validate your address.
>>>
>>> On Wednesday, 10 October 2012 20:22:02 UTC-5, curiouslearn wrote:
>>>>
>>>> Hello,
>>>>
>>>> I was hosting a web2py application on dotcloud.com with the older 
>>>> version of web2py (I think, 1.99.7, definitely below 2.0).
>>>> Everything was working great.
>>>>
>>>> To host on dotcloud the following steps were necessary and sufficient 
>>>> with that version:
>>>>
>>>> (i) Add a dotcloud.yml file to the web2py folder with content
>>>>
>>>>  www:
>>>>     type: python
>>>>  db:
>>>>     type: mysql
>>>>
>>>>
>>>> (ii) Change name of the setup.py file to something else such as 
>>>> setup_old.py
>>>>
>>>> (iii) Copy wsgihandler.py to wsgi.py.
>>>>
>>>> That was sufficient if you did not use any modules that did not come 
>>>> with basic python.
>>>> You had to then just use 
>>>>
>>>> dotcloud push <applicationname>
>>>>
>>>> This was truly awesome. However, after I upgraded to web2py version 
>>>> 2.0.9 and followed the same
>>>> steps, my application stopped working. I got the following error 
>>>> whenever I visited 
>>>> my application:
>>>>
>>>> Bad Request (request.client=::ffff:xx:xx:xx:xxx)
>>>>
>>>>
>>>>
>>>> where xx:xx:xx:xxx was my ip address.
>>>>
>>>>
>>>>
>>>> I contact dotcloud support and the tech support told me the following 
>>>> (in his words)
>>>>
>>>>   The current error comes from gluon/main.py line 144. This seems to 
>>>> be related to testing the IP address for validity in gluon/utils.py 
>>>> (is_valid_ip_address) which seems to be returning False.
>>>>
>>>> ...I suggest you dig into that function more to find out whether 
>>>> validating the ip address is important, and, if so, why this 
>>>> is_valid_ip_address failed on IPV6 addresses.
>>>>
>>>> Can someone please help with this? Is this a bug, or is this the 
>>>> intended behavior and I need to 
>>>> change something? I have no trouble running web2py on the localhost 
>>>> without this change. 
>>>>
>>>> Thank you.
>>>>
>>>

-- 



Reply via email to