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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-workhorse
Commits
f819a3c5
Commit
f819a3c5
authored
Feb 11, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Handler to Injecter
parent
2788c575
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
internal/git/archive.go
internal/git/archive.go
+1
-1
internal/git/blob.go
internal/git/blob.go
+1
-1
internal/inject/sendfile.go
internal/inject/sendfile.go
+2
-2
internal/senddata/injecter.go
internal/senddata/injecter.go
+2
-2
No files found.
internal/git/archive.go
View file @
f819a3c5
...
@@ -24,7 +24,7 @@ type archive struct{ senddata.Prefix }
...
@@ -24,7 +24,7 @@ type archive struct{ senddata.Prefix }
var
SendArchive
=
&
archive
{
"git-archive:"
}
var
SendArchive
=
&
archive
{
"git-archive:"
}
func
(
a
*
archive
)
Handle
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
sendData
string
)
{
func
(
a
*
archive
)
Inject
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
sendData
string
)
{
var
params
struct
{
var
params
struct
{
RepoPath
string
RepoPath
string
ArchivePath
string
ArchivePath
string
...
...
internal/git/blob.go
View file @
f819a3c5
...
@@ -13,7 +13,7 @@ type blob struct{ senddata.Prefix }
...
@@ -13,7 +13,7 @@ type blob struct{ senddata.Prefix }
var
SendBlob
=
&
blob
{
"git-blob:"
}
var
SendBlob
=
&
blob
{
"git-blob:"
}
func
(
b
*
blob
)
Handle
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
sendData
string
)
{
func
(
b
*
blob
)
Inject
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
sendData
string
)
{
var
params
struct
{
RepoPath
,
BlobId
string
}
var
params
struct
{
RepoPath
,
BlobId
string
}
if
err
:=
b
.
Unpack
(
&
params
,
sendData
);
err
!=
nil
{
if
err
:=
b
.
Unpack
(
&
params
,
sendData
);
err
!=
nil
{
helper
.
Fail500
(
w
,
fmt
.
Errorf
(
"SendBlob: unpack sendData: %v"
,
err
))
helper
.
Fail500
(
w
,
fmt
.
Errorf
(
"SendBlob: unpack sendData: %v"
,
err
))
...
...
internal/inject/sendfile.go
View file @
f819a3c5
...
@@ -70,13 +70,13 @@ func (s *sendFileResponseWriter) WriteHeader(status int) {
...
@@ -70,13 +70,13 @@ func (s *sendFileResponseWriter) WriteHeader(status int) {
if
header
:=
s
.
Header
()
.
Get
(
senddata
.
Header
);
header
!=
""
{
if
header
:=
s
.
Header
()
.
Get
(
senddata
.
Header
);
header
!=
""
{
s
.
Header
()
.
Del
(
senddata
.
Header
)
s
.
Header
()
.
Del
(
senddata
.
Header
)
for
_
,
handler
:=
range
[]
senddata
.
Handl
er
{
for
_
,
handler
:=
range
[]
senddata
.
Inject
er
{
git
.
SendBlob
,
git
.
SendBlob
,
git
.
SendArchive
,
git
.
SendArchive
,
}
{
}
{
if
handler
.
Match
(
header
)
{
if
handler
.
Match
(
header
)
{
s
.
hijacked
=
true
s
.
hijacked
=
true
handler
.
Handle
(
s
.
rw
,
s
.
req
,
header
)
handler
.
Inject
(
s
.
rw
,
s
.
req
,
header
)
return
return
}
}
}
}
...
...
internal/senddata/
handl
er.go
→
internal/senddata/
inject
er.go
View file @
f819a3c5
...
@@ -7,9 +7,9 @@ import (
...
@@ -7,9 +7,9 @@ import (
"strings"
"strings"
)
)
type
Handl
er
interface
{
type
Inject
er
interface
{
Match
(
string
)
bool
Match
(
string
)
bool
Handle
(
http
.
ResponseWriter
,
*
http
.
Request
,
string
)
Inject
(
http
.
ResponseWriter
,
*
http
.
Request
,
string
)
}
}
type
Prefix
string
type
Prefix
string
...
...
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