Commit f26992e2 authored by Jeromy's avatar Jeromy

address most of CR comments

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>
parent c30cd9ea
......@@ -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 == "symlink" {
if contentType == applicationSymlink {
out, err := ioutil.ReadAll(part)
if err != nil {
return nil, err
......
......@@ -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')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment