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
27d3b1c3
Commit
27d3b1c3
authored
Mar 02, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ReadAll
parent
7f508893
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
8 deletions
+1
-8
internal/helper/helpers.go
internal/helper/helpers.go
+1
-8
No files found.
internal/helper/helpers.go
View file @
27d3b1c3
...
...
@@ -3,7 +3,6 @@ package helper
import
(
"bytes"
"errors"
"io"
"io/ioutil"
"log"
"mime"
...
...
@@ -185,13 +184,7 @@ func ReadRequestBody(w http.ResponseWriter, r *http.Request, maxBodySize int64)
limitedBody
:=
http
.
MaxBytesReader
(
w
,
r
.
Body
,
maxBodySize
)
defer
limitedBody
.
Close
()
var
body
bytes
.
Buffer
_
,
err
:=
io
.
Copy
(
&
body
,
limitedBody
)
if
err
!=
nil
{
return
nil
,
err
}
return
body
.
Bytes
(),
nil
return
ioutil
.
ReadAll
(
limitedBody
)
}
func
CloneRequestWithNewBody
(
r
*
http
.
Request
,
body
[]
byte
)
*
http
.
Request
{
...
...
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