Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.go eol=lf
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Build

on:
schedule:
- cron: "0 6 * * THU"
push:
tags-ignore:
- "**"
Expand Down
4 changes: 2 additions & 2 deletions internal/testutil/rng.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func RNG(tb testing.TB) *mand.Rand {
tb.Fatalf("failed seeding RNG: %v", err)
}

seed := int64(binary.BigEndian.Uint64(buf))
return mand.New(mand.NewSource(seed)) //nolint:gosec // not returning a CSPRNG
seed := int64(binary.BigEndian.Uint64(buf)) //nolint:gosec // no issue with any possible overflow
return mand.New(mand.NewSource(seed)) //nolint:gosec // not returning a CSPRNG
}

// HexString returns a string of l hex characters.
Expand Down
7 changes: 4 additions & 3 deletions replay/replay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ func TestIn(t *testing.T) {

testutil.AssertEqual(t, http.StatusConflict, res.StatusCode)
testutil.AssertEqual(t, http.StatusText(http.StatusConflict)+"\n", got)
testutil.AssertEqual(t, kase.exp(), res.Header.Get("fly-replay"))
v := res.Header.Get("fly-replay") //nolint:canonicalheader // fly dox specify this header
testutil.AssertEqual(t, kase.exp(), v)
})
}
}
Expand All @@ -71,7 +72,7 @@ func TestSource(t *testing.T) {
buildRequest := func(add bool, hdr string) (r *http.Request) {
r = httptest.NewRequest(http.MethodGet, "/", nil)
if add {
r.Header.Add("fly-replay-src", hdr)
r.Header.Add("fly-replay-src", hdr) //nolint:canonicalheader // fly dox specify this header
}

return r
Expand Down Expand Up @@ -161,7 +162,7 @@ func TestInRegionHandlerForOtherRegion(t *testing.T) {
testutil.AssertEqual(t, http.StatusConflict, res.StatusCode)

exp := fmt.Sprintf("region=%s;state=%s", primaryRegion, state)
testutil.AssertEqual(t, res.Header.Get("fly-replay"), exp)
testutil.AssertEqual(t, res.Header.Get("fly-replay"), exp) //nolint:canonicalheader // fly dox specify this header
}

func setupInRegionHandlerTest(t *testing.T) (region, state string) {
Expand Down
8 changes: 4 additions & 4 deletions request/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestID(t *testing.T) {
exp := testutil.HexString(t, 26)

req := httptest.NewRequest(http.MethodGet, "/", nil)
req.Header.Set("fly-request-id", exp)
req.Header.Set("fly-request-id", exp) //nolint:canonicalheader // fly dox specify this header

testutil.AssertEqual(t, exp, ID(req))
}
Expand All @@ -43,7 +43,7 @@ func TestRegion(t *testing.T) {
exp := testutil.HexString(t, 3)

req := httptest.NewRequest(http.MethodGet, "/", nil)
req.Header.Set("fly-region", exp)
req.Header.Set("fly-region", exp) //nolint:canonicalheader // fly dox specify this header

testutil.AssertEqual(t, exp, Region(req))
}
Expand Down Expand Up @@ -76,7 +76,7 @@ func TestClientIP(t *testing.T) {

t.Run(strconv.Itoa(caseIndex), func(t *testing.T) {
req := httptest.NewRequest(http.MethodGet, "/", nil)
req.Header.Set("fly-client-ip", kase.lit)
req.Header.Set("fly-client-ip", kase.lit) //nolint:canonicalheader // fly dox specify this header

testutil.AssertEqual(t, kase.exp, ClientIP(req))
})
Expand Down Expand Up @@ -114,7 +114,7 @@ func TestForwardedPort(t *testing.T) {

t.Run(strconv.Itoa(caseIndex), func(t *testing.T) {
req := httptest.NewRequest(http.MethodGet, "/", nil)
req.Header.Set("fly-forwarded-port", kase.lit)
req.Header.Set("fly-forwarded-port", kase.lit) //nolint:canonicalheader // fly dox specify this header

testutil.AssertEqual(t, kase.exp, ForwardedPort(req))
})
Expand Down
Loading