challenge/resource-load: use proper redirect URL to current issued challenge, add static/dynamic cache bust
This commit is contained in:
@@ -167,15 +167,14 @@ func GetRemoteAddress(ctx context.Context) *netip.AddrPort {
|
||||
return &ip
|
||||
}
|
||||
|
||||
func CacheBust() string {
|
||||
return cacheBust
|
||||
}
|
||||
|
||||
var cacheBust string
|
||||
|
||||
func init() {
|
||||
|
||||
buf := make([]byte, 16)
|
||||
func RandomCacheBust(n int) string {
|
||||
buf := make([]byte, n)
|
||||
_, _ = rand.Read(buf)
|
||||
cacheBust = base64.RawURLEncoding.EncodeToString(buf)
|
||||
return base64.RawURLEncoding.EncodeToString(buf)
|
||||
}
|
||||
|
||||
var staticCacheBust = RandomCacheBust(16)
|
||||
|
||||
func StaticCacheBust() string {
|
||||
return staticCacheBust
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user