tomasz bandura
2017-01-07 20:16:09 UTC
Hello,
After upgrading to 0.12.11 ( or newer) , I noticed a problem with
forwarding request with any query data.
The example of simple application to reproduce my problem:
[file test.py]
from bottle import route, run, redirect,request
@route('/hello')
def hello():
print 'a1:',request.query.a1
return "Hello World!"
@route('/test')
def test():
a1 = request.query.a1
a2 = request.query.a2
redirect('/hello?a1=%s&a2=%s' % (a1,a2))
run(host='localhost', port=8080, debug=True)
When I try to invoke for example link:
http://localhos:8080/test?a1=123&a2=456 , bottle raises an exception:
Critical error (...)
AssertionError('Header values must be strings',)
Traceback:
Traceback (most recent call last): File
"(...)/python/bottle/test/venv/lib/python2.7/site-packages/bottle.py", line
960, in wsgi start_response(response._status_line, response.headerlist)
File "/usr/lib64/python2.7/wsgiref/handlers.py", line 180, in
start_response assert type(val) is StringType,"Header values must be
strings" AssertionError: Header values must be strings
I also checked it on Windows OS - the same error.
This example works correctly with bottle 0.12.10 and older.
Is something wrong in my redirect or is there any other method to make
redirect with query data?
Regards,
Tomasz
--
After upgrading to 0.12.11 ( or newer) , I noticed a problem with
forwarding request with any query data.
The example of simple application to reproduce my problem:
[file test.py]
from bottle import route, run, redirect,request
@route('/hello')
def hello():
print 'a1:',request.query.a1
return "Hello World!"
@route('/test')
def test():
a1 = request.query.a1
a2 = request.query.a2
redirect('/hello?a1=%s&a2=%s' % (a1,a2))
run(host='localhost', port=8080, debug=True)
When I try to invoke for example link:
http://localhos:8080/test?a1=123&a2=456 , bottle raises an exception:
Critical error (...)
AssertionError('Header values must be strings',)
Traceback:
Traceback (most recent call last): File
"(...)/python/bottle/test/venv/lib/python2.7/site-packages/bottle.py", line
960, in wsgi start_response(response._status_line, response.headerlist)
File "/usr/lib64/python2.7/wsgiref/handlers.py", line 180, in
start_response assert type(val) is StringType,"Header values must be
strings" AssertionError: Header values must be strings
I also checked it on Windows OS - the same error.
This example works correctly with bottle 0.12.10 and older.
Is something wrong in my redirect or is there any other method to make
redirect with query data?
Regards,
Tomasz
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.