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
4e02ae9d
Commit
4e02ae9d
authored
Nov 03, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Nov 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands/http: Respond with error if encoding option isn't a string
parent
a14ee931
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
http/handler.go
http/handler.go
+6
-1
No files found.
http/handler.go
View file @
4e02ae9d
...
@@ -43,7 +43,12 @@ func (i Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
...
@@ -43,7 +43,12 @@ func (i Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w
.
Header
()
.
Set
(
"Content-Type"
,
"application/octet-stream"
)
w
.
Header
()
.
Set
(
"Content-Type"
,
"application/octet-stream"
)
}
else
{
}
else
{
enc
,
_
:=
req
.
Option
(
cmds
.
EncShort
)
enc
,
_
:=
req
.
Option
(
cmds
.
EncShort
)
mime
:=
mimeTypes
[
enc
.
(
string
)]
encStr
,
ok
:=
enc
.
(
string
)
if
!
ok
{
w
.
WriteHeader
(
http
.
StatusInternalServerError
)
return
}
mime
:=
mimeTypes
[
encStr
]
w
.
Header
()
.
Set
(
"Content-Type"
,
mime
)
w
.
Header
()
.
Set
(
"Content-Type"
,
mime
)
}
}
...
...
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