mirror of
https://github.com/MontFerret/ferret.git
synced 2025-03-03 15:02:32 +02:00
20 lines
291 B
Go
20 lines
291 B
Go
package common
|
|
|
|
import (
|
|
"github.com/MontFerret/ferret/pkg/runtime/env"
|
|
"github.com/corpix/uarand"
|
|
)
|
|
|
|
func GetUserAgent(val string) string {
|
|
if val == "" {
|
|
return val
|
|
}
|
|
|
|
if val != env.RandomUserAgent {
|
|
return val
|
|
}
|
|
|
|
// TODO: Change the implementation
|
|
return uarand.GetRandom()
|
|
}
|