Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-cmds
Commits
f26992e2
Commit
f26992e2
authored
Sep 02, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address most of CR comments
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
c30cd9ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
files/multipartfile.go
files/multipartfile.go
+3
-1
http/multifilereader.go
http/multifilereader.go
+1
-2
No files found.
files/multipartfile.go
View file @
f26992e2
...
...
@@ -12,6 +12,8 @@ const (
multipartFormdataType
=
"multipart/form-data"
multipartMixedType
=
"multipart/mixed"
applicationSymlink
=
"application/symlink"
contentTypeHeader
=
"Content-Type"
)
...
...
@@ -31,7 +33,7 @@ func NewFileFromPart(part *multipart.Part) (File, error) {
}
contentType
:=
part
.
Header
.
Get
(
contentTypeHeader
)
if
contentType
==
"s
ymlink
"
{
if
contentType
==
applicationS
ymlink
{
out
,
err
:=
ioutil
.
ReadAll
(
part
)
if
err
!=
nil
{
return
nil
,
err
...
...
http/multifilereader.go
View file @
f26992e2
...
...
@@ -69,8 +69,7 @@ func (mfr *MultiFileReader) Read(buf []byte) (written int, err error) {
if
s
,
ok
:=
file
.
(
*
files
.
Symlink
);
ok
{
mfr
.
currentFile
=
s
// TODO(why): this is a hack. pick a real contentType
contentType
=
"symlink"
contentType
=
"application/symlink"
}
else
if
file
.
IsDirectory
()
{
// if file is a directory, create a multifilereader from it
// (using 'multipart/mixed')
...
...
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