github.com/MontFerret/ferret@v0.18.0/pkg/drivers/common/ua.go (about)

     1  package common
     2  
     3  import (
     4  	"github.com/corpix/uarand"
     5  )
     6  
     7  const RandomUserAgent = "*"
     8  
     9  func GetUserAgent(val string) string {
    10  	if val == "" {
    11  		return val
    12  	}
    13  
    14  	if val != RandomUserAgent {
    15  		return val
    16  	}
    17  
    18  	// TODO: Change the implementation
    19  	return uarand.GetRandom()
    20  }