forked from alphagov/cdn-acceptance-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cdn_nomanipulate_test.go
52 lines (38 loc) · 1.42 KB
/
cdn_nomanipulate_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"testing"
)
// Verify that the CDN is not manipulating response bodies such as code
// minification or optimisation, lossy or lossless image compression,
// stripping image metadata, etc. We do not want this to happen magically,
// we'd rather do it ourselves.
// Should not manipulate HTML content in response bodies.
func TestNoManipulationHTML(t *testing.T) {
ResetBackends(backendsByPriority)
testResponseNotManipulated(t, "fixtures/golang.html")
}
// Should not manipulate CSS content in response bodies.
func TestNoManipulationCSS(t *testing.T) {
ResetBackends(backendsByPriority)
testResponseNotManipulated(t, "fixtures/golang.css")
}
// Should not manipulate JavaScript content in response bodies.
func TestNoManipulationJS(t *testing.T) {
ResetBackends(backendsByPriority)
testResponseNotManipulated(t, "fixtures/golang.js")
}
// Should not manipulate PNG images in response bodies.
func TestNoManipulationPNG(t *testing.T) {
ResetBackends(backendsByPriority)
testResponseNotManipulated(t, "fixtures/golang.png")
}
// Should not manipulate JPEG images in response bodies.
func TestNoManipulationJPEG(t *testing.T) {
ResetBackends(backendsByPriority)
testResponseNotManipulated(t, "fixtures/golang.jpeg")
}
// Should not manipulate GIF images in response bodies.
func TestNoManipulationGIF(t *testing.T) {
ResetBackends(backendsByPriority)
testResponseNotManipulated(t, "fixtures/golang.gif")
}