Skip to content

Commit a8ff354

Browse files
authored
Use embed for pixel so it is a proper png file (#4106)
1 parent 3dc2749 commit a8ff354

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

util/httputil/pixel.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
package httputil
22

3+
import _ "embed"
4+
35
type Pixel struct {
46
Content []byte
57
ContentType string
68
}
79

10+
//go:embed pixel.png
11+
var pixelContent []byte
812
var Pixel1x1PNG = Pixel{
9-
Content: []byte{0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44,
10-
0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F, 0x15, 0xC4,
11-
0x89, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7C, 0x08, 0x64, 0x88,
12-
0x00, 0x00, 0x00, 0x0D, 0x49, 0x44, 0x41, 0x54, 0x08, 0x99, 0x63, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00,
13-
0x00, 0x05, 0x00, 0x01, 0x87, 0xA1, 0x4E, 0xD4, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE,
14-
0x42, 0x60, 0x82},
13+
Content: pixelContent,
1514
ContentType: "image/png",
1615
}

util/httputil/pixel.png

86 Bytes
Loading

0 commit comments

Comments
 (0)