From 89063658975979c192dcc68fc357809bb01bed22 Mon Sep 17 00:00:00 2001
From: George Shammas <george@shamm.as>
Date: Wed, 5 Jan 2022 10:29:56 -0500
Subject: [PATCH] Understand more useragents to be commandline

---
 main.go | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/main.go b/main.go
index 59260af..bdfb7cf 100644
--- a/main.go
+++ b/main.go
@@ -3,13 +3,14 @@ package main
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/gin-gonic/gin"
-	proxyproto "github.com/pires/go-proxyproto"
 	"net"
 	"os"
 	"strconv"
 	"strings"
 	"time"
+
+	"github.com/gin-gonic/gin"
+	proxyproto "github.com/pires/go-proxyproto"
 )
 
 type Configuration struct {
@@ -243,5 +244,10 @@ func main() {
 }
 
 func isReqFromCmdLine(ua string) bool {
-	return strings.HasPrefix(ua, "curl") || strings.HasPrefix(ua, "HTTPie")
+	parts := strings.SplitN(ua, "/", 2)
+	switch parts[0] {
+	case "curl", "HTTPie", "httpie-go", "Wget", "fetch libfetch", "Go", "Go-http-client", "ddclient", "Mikrotik", "xh":
+		return true
+	}
+	return false
 }