-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathCaddyfile
More file actions
38 lines (34 loc) · 984 Bytes
/
Copy pathCaddyfile
File metadata and controls
38 lines (34 loc) · 984 Bytes
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
{
admin off
}
# caddy run
#
# endpoint for basic auth app testing
:7080 {
basic_auth {
# user: admin
# password: secret
admin $2a$14$6raEvbSOkbyTizzW36qguOAJUfMf1Jc2uUEVxue33xkhDdygvRhCC
}
# evcc running locally
reverse_proxy http://localhost:7070
}
# endpoint for cookie-protected app testing — mirrors evcc's HttpOnly auth
# cookie so e2e can prove the webview's cookies are forwarded to downloads
:7081 {
# /cookietest/file.csv returns 401 unless `testauth=letmein` is sent
handle /cookietest/file.csv {
@hasCookie header_regexp Cookie ".*testauth=letmein.*"
handle @hasCookie {
header Content-Type "text/csv"
respond "cookie,present\ntestauth,letmein\n" 200
}
respond 401
}
# every other response sets the HttpOnly cookie so the webview picks it
# up on its initial load and replays it on subsequent in-page fetches
handle {
header +Set-Cookie "testauth=letmein; Path=/; HttpOnly; SameSite=Strict"
reverse_proxy http://localhost:7070
}
}