Skip to content

Commit

Permalink
push: infer mimeType from extension only when !IsDir
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Odeke committed Apr 26, 2015
1 parent 68f8745 commit 231b3d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ var regExtStrMap = map[string]string{
"rtf": "application/rtf",
"pdf": "application/pdf",

"apk": "application/vnd.android.package-archive",
"bin": "application/octet-stream",
"apk": "application/vnd.android.package-archive",
"bin": "application/octet-stream",

"docx?": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"pptx?": "application/vnd.openxmlformats-officedocument.wordprocessingml.presentation",
Expand Down
2 changes: 1 addition & 1 deletion src/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func (g *Commands) remoteMod(change *Change) (err error) {
coercedMimeKey, ok := g.coercedMimeKey()
if ok {
args.mimeKey = coercedMimeKey
} else if args.src != nil { // Infer it from the extension
} else if args.src != nil && !args.src.IsDir { // Infer it from the extension
args.mimeKey = filepath.Ext(args.src.Name)
}

Expand Down

0 comments on commit 231b3d0

Please sign in to comment.