Compare commits

..

No commits in common. "27a8c3d1d1d534f8744e0397ff37e2cc25ec38c5" and "459d10664a33bc5942a1bc56e92a7fa79db69bff" have entirely different histories.

View file

@ -58,7 +58,7 @@ func handler(ctx *fasthttp.RequestCtx) {
)
row := stmt.QueryRow(
string(ctx.Method()),
ctx.Method(),
fmt.Sprintf(
"%s://%s:%s%s",
scheme,
@ -72,13 +72,9 @@ func handler(ctx *fasthttp.RequestCtx) {
var code int
err := row.Scan(&id, &code)
if err == sql.ErrNoRows {
if err != nil {
ctx.Response.SetStatusCode(404)
return
} else if err != nil {
ctx.Response.SetStatusCode(500)
ctx.Response.SetBodyString("Unable to fetch row: " + err.Error())
return
}
// -- set status code