package webshared

import "strings"

// TODO: Define linstrom uri type

var hardcodedUrls = map[string]string{
	"default-media": "/default-image",
}

func EnsurePublicUrl(rawUrl string) string {
	if !strings.HasPrefix(rawUrl, "linstrom://") {
		return rawUrl
	}
	url := strings.TrimPrefix(rawUrl, "linstrom://")
	if replacement, ok := hardcodedUrls[url]; ok {
		return replacement
	}
	return strings.Replace(rawUrl, "linstrom://", "/", 1)
}
