refactor: move Sprintf-generation of url out of func args

allows much better debugging + some readability
This commit is contained in:
DarkCat09 2024-07-02 20:13:36 +04:00
parent f08b63fa61
commit b1d2ba896c
Signed by: DarkCat09
GPG key ID: 0A26CD5B3345D6E3

View file

@ -58,17 +58,20 @@ func handler(ctx *fasthttp.RequestCtx) {
bytes.Equal(scheme, []byte("https")),
)
urlToSearch := fmt.Sprintf(
"%s://%s:%s%s",
scheme,
host,
port,
ctx.RequestURI(),
)
row := stmt.QueryRow(
string(ctx.Method()),
fmt.Sprintf(
"%s://%s:%s%s",
scheme,
host,
port,
ctx.RequestURI(),
),
urlToSearch,
)
// log.Println(urlToSearch)
var id int
var code int