File tree 6 files changed +133
-3
lines changed
6 files changed +133
-3
lines changed Original file line number Diff line number Diff line change @@ -137,15 +137,14 @@ jobs:
137
137
138
138
- name : Run Caddy
139
139
if : matrix.os == 'linux' && matrix.go == '1.22'
140
- working-directory : ./cmd/caddy
141
140
run : |
142
- ./caddy start
141
+ ./cmd/caddy/ caddy start
143
142
144
143
- name : Run tests with Hurl
145
144
if : matrix.os == 'linux' && matrix.go == '1.22'
146
145
run : |
147
146
mkdir hurl-report
148
- find . -name *.hurl -exec hurl --very-verbose --verbose --test --report-junit hurl-report/junit.xml --color {} \;
147
+ find . -name *.hurl -exec hurl --variables-file caddytest/spec/hurl_vars.properties -- very-verbose --verbose --test --report-junit hurl-report/junit.xml --color {} \;
149
148
150
149
- name : Publish Test Results
151
150
if : matrix.os == 'linux' && matrix.go == '1.22'
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < title > Index.html Title</ title >
5
+ </ head >
6
+ < body >
7
+ Index.html
8
+ </ body >
9
+ </ html >
Original file line number Diff line number Diff line change
1
+ index.txt
Original file line number Diff line number Diff line change
1
+ # Configure Caddy with default configuration
2
+ POST http://localhost:2019/load
3
+ Content-Type: text/caddyfile
4
+ ```
5
+ {
6
+ skip_install_trust
7
+ http_port 9080
8
+ https_port 9443
9
+ local_certs
10
+ debug
11
+ }
12
+ localhost {
13
+ root {{indexed_root}}
14
+ file_server
15
+ }
16
+ ```
17
+
18
+ # requests without specific file receive index file per
19
+ # the default index list: index.html, index.txt
20
+ GET https://localhost:9443
21
+ [Options]
22
+ insecure: true
23
+ HTTP 200
24
+ [Asserts]
25
+ ```
26
+ <!DOCTYPE html>
27
+ <html>
28
+ <head>
29
+ <title>Index.html Title</title>
30
+ </head>
31
+ <body>
32
+ Index.html
33
+ </body>
34
+ </html>```
35
+
36
+
37
+ # if index.txt is specifically requested, we expect index.txt
38
+ GET https://localhost:9443/index.txt
39
+ [Options]
40
+ insecure: true
41
+ HTTP 200
42
+ [Asserts]
43
+ body == "index.txt"
44
+
45
+ # requests for sub-folder followed by .. result in sanitized path
46
+ GET https://localhost:9443/non-existent/../index.txt
47
+ [Options]
48
+ insecure: true
49
+ HTTP 200
50
+ [Asserts]
51
+ body == "index.txt"
52
+
53
+ # results out of root folder are sanitized,
54
+ # and conform to default index list sequence.
55
+ GET https://localhost:9443/../
56
+ [Options]
57
+ insecure: true
58
+ HTTP 200
59
+ [Asserts]
60
+ ```
61
+ <!DOCTYPE html>
62
+ <html>
63
+ <head>
64
+ <title>Index.html Title</title>
65
+ </head>
66
+ <body>
67
+ Index.html
68
+ </body>
69
+ </html>```
70
+
71
+
72
+ # Configure Caddy with custsom index "index.txt"
73
+ POST http://localhost:2019/load
74
+ Content-Type: text/caddyfile
75
+ ```
76
+ {
77
+ skip_install_trust
78
+ http_port 9080
79
+ https_port 9443
80
+ local_certs
81
+ debug
82
+ }
83
+ localhost {
84
+ root {{indexed_root}}
85
+ file_server {
86
+ index index.txt
87
+ }
88
+ }
89
+ ```
90
+
91
+ GET https://localhost:9443
92
+ [Options]
93
+ insecure: true
94
+ HTTP 200
95
+ [Asserts]
96
+ body == "index.txt"
97
+
98
+
99
+ # Configure with a root not containing index files
100
+ POST http://localhost:2019/load
101
+ Content-Type: text/caddyfile
102
+ ```
103
+ {
104
+ skip_install_trust
105
+ http_port 9080
106
+ https_port 9443
107
+ local_certs
108
+ debug
109
+ }
110
+ localhost {
111
+ root {{unindexed_root}}
112
+ file_server
113
+ }
114
+ ```
115
+
116
+ GET https://localhost:9443
117
+ [Options]
118
+ insecure: true
119
+ HTTP 404
Original file line number Diff line number Diff line change
1
+ indexed_root =caddytest/spec/http/file_server/assets/indexed
2
+ unindexed_root =caddytest/spec/http/file_server/assets/unindexed
You can’t perform that action at this time.
0 commit comments