mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
wip: 🔕 temporary commit
This commit is contained in:
parent
2776c41e0d
commit
a759504971
@ -317,13 +317,18 @@ func (cmd *command) Run(ctx context.Context, log *logger.Logger, cfg *config.Con
|
|||||||
// url=https%3A%2F%2Ferror-pages.goatcounter.com%2Fcounter%2F%2Fuse-template%2Flost-in-space.json
|
// url=https%3A%2F%2Ferror-pages.goatcounter.com%2Fcounter%2F%2Fuse-template%2Flost-in-space.json
|
||||||
// &query=%24.count&label=Used%20times)
|
// &query=%24.count&label=Used%20times)
|
||||||
go func() {
|
go func() {
|
||||||
|
var tpl = url.QueryEscape(cfg.TemplateName)
|
||||||
|
|
||||||
req, reqErr := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf(
|
req, reqErr := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf(
|
||||||
"https://error-pages.goatcounter.com/count?event=true&p=/use-template/%s", url.QueryEscape(cfg.TemplateName),
|
// https://www.goatcounter.com/help/pixel
|
||||||
|
"https://error-pages.goatcounter.com/count?e=true&p=/use-template/%s&t=%s", tpl, tpl,
|
||||||
), http.NoBody)
|
), http.NoBody)
|
||||||
if reqErr != nil {
|
if reqErr != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req.Header.Set("User-Agent", "error-pages") // by default, the User-Agent is "Go-http-client/x.x"
|
||||||
|
|
||||||
resp, respErr := (&http.Client{Timeout: 10 * time.Second}).Do(req) //nolint:mnd // don't care about the response
|
resp, respErr := (&http.Client{Timeout: 10 * time.Second}).Do(req) //nolint:mnd // don't care about the response
|
||||||
if respErr != nil {
|
if respErr != nil {
|
||||||
log.Debug("Cannot send a request to increment the template usage counter", logger.Error(respErr))
|
log.Debug("Cannot send a request to increment the template usage counter", logger.Error(respErr))
|
||||||
|
273
templates/orient.html
Normal file
273
templates/orient.html
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user