mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-27 15:08:14 +02:00
userinfo: embed assets as data URLs for forward auth
This commit is contained in:
parent
f67b33484b
commit
a85f77df53
2 changed files with 57 additions and 0 deletions
11
internal/urlutil/data.go
Normal file
11
internal/urlutil/data.go
Normal file
|
@ -0,0 +1,11 @@
|
|||
package urlutil
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
)
|
||||
|
||||
// DataURL returns a data-url for the data.
|
||||
func DataURL(mediaType string, data []byte) string {
|
||||
bs := base64.StdEncoding.EncodeToString(data)
|
||||
return "data:" + mediaType + ";base64," + bs
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue