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
fc80c6a3
Commit
fc80c6a3
authored
Jan 19, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit upload-pack request body size to 10MB
parent
8dd2d3eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
internal/git/upload-pack.go
internal/git/upload-pack.go
+4
-1
No files found.
internal/git/upload-pack.go
View file @
fc80c6a3
...
...
@@ -10,7 +10,10 @@ import (
)
func
handleUploadPack
(
w
*
GitHttpResponseWriter
,
r
*
http
.
Request
,
a
*
api
.
Response
)
(
writtenIn
int64
,
err
error
)
{
buffer
,
err
:=
helper
.
ReadAllTempfile
(
r
.
Body
)
// The body will consist almost entirely of 'have XXX' and 'want XXX'
// lines; these are about 50 bytes long. With a limit of 10MB the client
// can send over 200,000 have/want lines.
buffer
,
err
:=
helper
.
ReadAllTempfile
(
io
.
LimitReader
(
r
.
Body
,
10
*
1024
*
1024
))
if
err
!=
nil
{
fail500
(
w
)
return
writtenIn
,
fmt
.
Errorf
(
"ReadAllTempfile: %v"
,
err
)
...
...
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