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
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
Kazuhiko Shiozaki
gitlab-workhorse
Commits
9cf03a66
Commit
9cf03a66
authored
Jan 19, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove magic number from metadata header trest
parent
4b93d856
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
internal/artifacts/artifacts_upload_test.go
internal/artifacts/artifacts_upload_test.go
+1
-1
internal/artifacts/metadata.go
internal/artifacts/metadata.go
+1
-0
No files found.
internal/artifacts/artifacts_upload_test.go
View file @
9cf03a66
...
@@ -71,7 +71,7 @@ func testArtifactsUploadServer(t *testing.T, tempPath string) *httptest.Server {
...
@@ -71,7 +71,7 @@ func testArtifactsUploadServer(t *testing.T, tempPath string) *httptest.Server {
w
.
WriteHeader
(
404
)
w
.
WriteHeader
(
404
)
return
return
}
}
if
!
bytes
.
HasPrefix
(
metadata
[
4
:
],
[]
byte
(
metadataHeader
))
{
if
!
bytes
.
HasPrefix
(
metadata
,
[]
byte
(
metadataHeaderPrefix
+
metadataHeader
))
{
w
.
WriteHeader
(
400
)
w
.
WriteHeader
(
400
)
return
return
}
}
...
...
internal/artifacts/metadata.go
View file @
9cf03a66
...
@@ -19,6 +19,7 @@ type metadata struct {
...
@@ -19,6 +19,7 @@ type metadata struct {
Comment
string
`json:"comment,omitempty"`
Comment
string
`json:"comment,omitempty"`
}
}
const
metadataHeaderPrefix
=
"
\x00\x00\x00
&"
// length of string below, encoded properly
const
metadataHeader
=
"GitLab Build Artifacts Metadata 0.0.2
\n
"
const
metadataHeader
=
"GitLab Build Artifacts Metadata 0.0.2
\n
"
func
newMetadata
(
file
*
zip
.
File
)
metadata
{
func
newMetadata
(
file
*
zip
.
File
)
metadata
{
...
...
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