You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2020/06/03 16:05:31 UTC
[allura] 09/12: [#8361] more header encoding fixes
This is an automated email from the ASF dual-hosted git repository.
kentontaylor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git
commit 8c45db876bec1b3bdad3cfab1f43b2289c1b8c8f
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon May 18 17:23:06 2020 -0400
[#8361] more header encoding fixes
---
Allura/allura/tests/functional/test_discuss.py | 11 +++++------
ForgeBlog/forgeblog/main.py | 2 +-
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/Allura/allura/tests/functional/test_discuss.py b/Allura/allura/tests/functional/test_discuss.py
index 80b8633..8518b00 100644
--- a/Allura/allura/tests/functional/test_discuss.py
+++ b/Allura/allura/tests/functional/test_discuss.py
@@ -31,7 +31,6 @@ from io import open
from six.moves import range
-
class TestDiscussBase(TestController):
def _thread_link(self):
@@ -110,7 +109,7 @@ class TestDiscuss(TestDiscussBase):
params[post_form.find('textarea')['name']] = 'This is a new post'
r = self.app.post(post_link,
params=params,
- headers={str('Referer'): str(thread_link.encode("utf-8"))})
+ headers={str('Referer'): str(thread_link)})
r = r.follow()
assert 'This is a new post' in r, r
r = self.app.get(post_link)
@@ -124,10 +123,10 @@ class TestDiscuss(TestDiscussBase):
params[post_form.find('textarea')['name']] = 'Tis a reply'
r = self.app.post(post_link + 'reply',
params=params,
- headers={str('Referer'): str(post_link.encode("utf-8"))})
+ headers={str('Referer'): str(post_link)})
r = self.app.get(thread_link)
assert 'Tis a reply' in r, r
- permalinks = [post.find('form')['action'].encode('utf-8')
+ permalinks = [post.find('form')['action']
for post in r.html.findAll('div', {'class': 'edit_post_form reply'})]
self.app.post(permalinks[1] + 'flag')
self.app.post(permalinks[1] + 'moderate', params=dict(delete='delete'))
@@ -409,7 +408,7 @@ class TestAttachment(TestDiscussBase):
for f in thread.html.findAll('form'):
if f.get('action', '').endswith('/post'):
break
- self.post_form_link = f['action'].encode('utf-8')
+ self.post_form_link = f['action']
params = dict()
inputs = f.findAll('input')
for field in inputs:
@@ -417,7 +416,7 @@ class TestAttachment(TestDiscussBase):
params[field['name']] = field.get('value') or ''
params[f.find('textarea')['name']] = 'Test Post'
r = self.app.post(f['action'], params=params,
- headers={str('Referer'): str(self.thread_link.encode('utf-8'))})
+ headers={str('Referer'): str(self.thread_link)})
r = r.follow()
self.post_link = str(
r.html.find('div', {'class': 'edit_post_form reply'}).find('form')['action'])
diff --git a/ForgeBlog/forgeblog/main.py b/ForgeBlog/forgeblog/main.py
index c27ed0b..6e286c2 100644
--- a/ForgeBlog/forgeblog/main.py
+++ b/ForgeBlog/forgeblog/main.py
@@ -592,7 +592,7 @@ class RootRestController(BaseController, AppRestControllerMixin):
text=text,
labels=labels.split(','),
**kw)
- return exc.HTTPCreated(headers=dict(Location=str(h.absurl('/rest' + post.url()).encode('utf-8'))))
+ return exc.HTTPCreated(headers=dict(Location=str(h.absurl('/rest' + post.url()))))
else:
result = RootController().index(limit=limit, page=page)