Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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-ce
Commits
275946fe
Commit
275946fe
authored
Feb 08, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Un set Content-Length for raw Git blobs
parent
55ce310d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
internal/git/blob.go
internal/git/blob.go
+2
-0
main_test.go
main_test.go
+0
-2
No files found.
internal/git/blob.go
View file @
275946fe
...
...
@@ -38,6 +38,8 @@ func SendBlob(w http.ResponseWriter, r *http.Request, sendData string) {
}
defer
helper
.
CleanUpProcessGroup
(
gitShowCmd
)
// Ignore incorrect Content-Length that may have been set by Rails
w
.
Header
()
.
Del
(
"Content-Length"
)
if
_
,
err
:=
io
.
Copy
(
w
,
stdout
);
err
!=
nil
{
helper
.
LogError
(
fmt
.
Errorf
(
"SendBlob: copy git cat-file stdout: %v"
,
err
))
return
...
...
main_test.go
View file @
275946fe
...
...
@@ -563,8 +563,6 @@ func TestGetGitBlob(t *testing.T) {
responseJSON
:=
fmt
.
Sprintf
(
`{"RepoPath":"%s","BlobId":"%s"}`
,
path
.
Join
(
testRepoRoot
,
testRepo
),
blobId
)
encodedJSON
:=
base64
.
StdEncoding
.
EncodeToString
([]
byte
(
responseJSON
))
w
.
Header
()
.
Set
(
headerKey
,
"git-blob:"
+
encodedJSON
)
// Prevent the Go HTTP server from setting the Content-Length to 0.
w
.
Header
()
.
Set
(
"Transfer-Encoding"
,
"chunked"
)
if
_
,
err
:=
fmt
.
Fprintf
(
w
,
"GNU General Public License"
);
err
!=
nil
{
t
.
Fatal
(
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