Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
41344f05
Commit
41344f05
authored
Feb 10, 2014
by
Sofia Papagiannaki
Browse files
pithos: Fix further unicode issues
parent
a268f327
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-pithos-app/pithos/api/test/views.py
View file @
41344f05
...
...
@@ -102,7 +102,8 @@ class ObjectGetView(PithosAPITest):
def
setUp
(
self
):
PithosAPITest
.
setUp
(
self
)
self
.
cname
=
self
.
create_container
()[
0
]
self
.
oname
,
self
.
odata
=
self
.
upload_object
(
self
.
cname
)[:
-
1
]
self
.
oname
,
self
.
odata
=
self
.
upload_object
(
self
.
cname
,
'φωτογραφία.JPG'
)[:
-
1
]
self
.
view_path
=
join_urls
(
get_service_path
(
pithos_settings
.
pithos_services
,
'pithos_ui'
),
'view'
)
...
...
@@ -141,6 +142,20 @@ class ObjectGetView(PithosAPITest):
self
.
assertEqual
(
r
.
status_code
,
200
)
self
.
assertTrue
(
r
.
content
,
self
.
odata
)
r
=
self
.
get
(
'%s&disposition-type=inline'
%
add_url_params
(
self
.
view_url
,
access_token
=
'valid_token'
))
self
.
assertEqual
(
r
.
status_code
,
200
)
self
.
assertTrue
(
r
.
content
,
self
.
odata
)
self
.
assertTrue
(
'Content-Disposition'
in
r
)
self
.
assertTrue
(
'inline'
in
r
[
'Content-Disposition'
])
r
=
self
.
get
(
'%s&disposition-type=attachment'
%
add_url_params
(
self
.
view_url
,
access_token
=
'valid_token'
))
self
.
assertEqual
(
r
.
status_code
,
200
)
self
.
assertTrue
(
r
.
content
,
self
.
odata
)
self
.
assertTrue
(
'Content-Disposition'
in
r
)
self
.
assertTrue
(
'attachment'
in
r
[
'Content-Disposition'
])
def
test_forbidden
(
self
):
container
=
self
.
create_container
(
user
=
'alice'
)[
0
]
obj
=
self
.
upload_object
(
container
,
user
=
'alice'
)[
0
]
...
...
snf-pithos-app/pithos/api/util.py
View file @
41344f05
...
...
@@ -260,8 +260,8 @@ def put_object_headers(response, meta, restricted=False, token=None,
disposition_type
=
disposition_type
if
disposition_type
in
\
(
'inline'
,
'attachment'
)
else
None
if
disposition_type
is
not
None
:
response
[
'Content-Disposition'
]
=
'%s; filename=%s'
%
(
disposition_type
,
meta
[
'name'
])
response
[
'Content-Disposition'
]
=
smart_str
(
'%s; filename=%s'
%
(
disposition_type
,
meta
[
'name'
])
,
strings_only
=
True
)
def
update_manifest_meta
(
request
,
v_account
,
meta
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment