From fc200cf84f272f8b8d6fb388092bad083a708b47 Mon Sep 17 00:00:00 2001 From: xuu Date: Wed, 2 Apr 2025 16:09:11 -0600 Subject: [PATCH] chore: fix usage bug --- http-api.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/http-api.go b/http-api.go index b001578..4cd194f 100644 --- a/http-api.go +++ b/http-api.go @@ -203,14 +203,13 @@ func addKey(preamble lextwt.Comments, key, value string, v ...any) lextwt.Commen } func mkPreamble(hostname, uri, path string, limit int, length, offset, end int64) lextwt.Comments { - hostname += path preamble := addKey(mkPreambleDocs(hostname), "twt range", "1 %d", end) - preamble = addKey(preamble, "self", "%s%s", hostname, mkqry(uri, limit, offset)) + preamble = addKey(preamble, "self", "%s%s%s", hostname, path, mkqry(uri, limit, offset)) if next := offset + length; next < end { - preamble = addKey(preamble, "next", "%s%s", hostname, mkqry(uri, limit, next)) + preamble = addKey(preamble, "next", "%s%s%s", hostname, path, mkqry(uri, limit, next)) } if prev := offset - int64(limit); prev > 0 { - preamble = addKey(preamble, "prev", "%s%s", hostname, mkqry(uri, limit, prev)) + preamble = addKey(preamble, "prev", "%s%s%s", hostname, path, mkqry(uri, limit, prev)) } return preamble }