Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-workhorse
Commits
162424b9
Commit
162424b9
authored
Mar 08, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always remove the senddata header
parent
ab7a52c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
internal/senddata/senddata.go
internal/senddata/senddata.go
+1
-0
internal/senddata/senddata_test.go
internal/senddata/senddata_test.go
+20
-0
No files found.
internal/senddata/senddata.go
View file @
162424b9
...
...
@@ -48,6 +48,7 @@ func (s *sendDataResponseWriter) WriteHeader(status int) {
return
}
s
.
Header
()
.
Del
(
HeaderKey
)
s
.
rw
.
WriteHeader
(
s
.
status
)
}
...
...
internal/senddata/senddata_test.go
0 → 100644
View file @
162424b9
package
senddata
import
(
"net/http"
"net/http/httptest"
"testing"
)
func
TestHeaderDelete
(
t
*
testing
.
T
)
{
for
_
,
code
:=
range
[]
int
{
200
,
400
}
{
recorder
:=
httptest
.
NewRecorder
()
rw
:=
&
sendDataResponseWriter
{
rw
:
recorder
,
req
:
&
http
.
Request
{}}
rw
.
Header
()
.
Set
(
HeaderKey
,
"foobar"
)
rw
.
WriteHeader
(
code
)
if
header
:=
recorder
.
Header
()
.
Get
(
HeaderKey
);
header
!=
""
{
t
.
Fatalf
(
"HTTP %d response: expected header to be empty, found %q"
,
code
,
header
)
}
}
}
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