mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-06 19:38:09 +02:00
zero/api: reset token and url cache if 401 is received (#5256)
zero/api: reset token cache if 401 is received
This commit is contained in:
parent
a04d1a450c
commit
ce12e51cf5
8 changed files with 91 additions and 32 deletions
|
@ -29,6 +29,13 @@ func NewURLCache() *URLCache {
|
|||
}
|
||||
}
|
||||
|
||||
func (c *URLCache) Delete(key string) {
|
||||
c.mx.Lock()
|
||||
defer c.mx.Unlock()
|
||||
|
||||
delete(c.cache, key)
|
||||
}
|
||||
|
||||
// Get gets the cache entry for the given key, if it exists and has not expired.
|
||||
func (c *URLCache) Get(key string, minTTL time.Duration) (*DownloadCacheEntry, bool) {
|
||||
c.mx.RLock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue