mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-29 18:36:30 +02:00
11 lines
240 B
Go
11 lines
240 B
Go
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
|
|
}
|