Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rfc6266
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
rfc6266
Commits
7a3a85b2
Commit
7a3a85b2
authored
Jan 30, 2012
by
Gabriel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More cautious handling of ascii-filenames that contain backslashes.
parent
9955380d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
rfc6266.py
+11
-6
No files found.
rfc6266.py
View file @
7a3a85b2
...
...
@@ -328,14 +328,19 @@ def header_for_filename(
if
disposition
!=
'attachment'
:
assert
is_token
(
disposition
)
if
is_token
(
filename
):
return
'
%
s; filename=
%
s'
%
(
disposition
,
filename
)
elif
is_ascii
(
filename
)
and
is_lws_safe
(
filename
):
return
'
%
s; filename="
%
s"'
%
(
disposition
,
qd_quote
(
filename
))
rv
=
disposition
if
filename_compat
:
if
is_token
(
filename
):
rv
+=
'; filename=
%
s'
%
(
filename
,
)
return
rv
elif
is_ascii
(
filename
)
and
is_lws_safe
(
filename
):
qd_filename
=
qd_quote
(
filename
)
rv
+=
'; filename="
%
s"'
%
(
qd_filename
,
)
if
qd_filename
==
filename
:
# RFC 6266 claims some implementations are iffy on qdtext's
# backslash-escaping, we'll include filename* in that case.
return
rv
elif
filename_compat
:
if
is_token
(
filename_compat
):
rv
+=
'; filename=
%
s'
%
(
filename_compat
,
)
else
:
...
...
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