Пример #1
0
func GetClientLicenseEtag() string {
	value := ""

	for k, v := range ClientLicense {
		value += fmt.Sprintf("%s:%s;", k, v)
	}

	return model.Etag(fmt.Sprintf("%x", md5.Sum([]byte(value))))
}
Пример #2
0
func getClientLicenceConfig(c *Context, w http.ResponseWriter, r *http.Request) {
	config := utils.ClientLicense

	var etag string
	if config["IsLicensed"] == "false" {
		etag = model.Etag(config["IsLicensed"])
	} else {
		etag = model.Etag(config["IsLicensed"], config["IssuedAt"])
	}

	if HandleEtag(etag, w, r) {
		return
	}

	w.Header().Set(model.HEADER_ETAG_SERVER, etag)

	w.Write([]byte(model.MapToJson(config)))
}
Пример #3
0
func GetClientLicenseEtag(useSanitized bool) string {
	value := ""

	lic := ClientLicense

	if useSanitized {
		lic = GetSanitizedClientLicense()
	}

	for k, v := range lic {
		value += fmt.Sprintf("%s:%s;", k, v)
	}

	return model.Etag(fmt.Sprintf("%x", md5.Sum([]byte(value))))
}