README: state the rule for a query that cannot be read (closes #5)
check / check (push) Successful in 1m9s
check / check (push) Successful in 1m9s
The README listed the queries that GET /api/v1/chats/{id}/messages
cannot read as if the list were complete, but a query of more than
10,000 parts separated by & is refused the same way, because Go's
url.ParseQuery takes no more. The README now states the rule, that a
query the server cannot read gets 400 with "the query cannot be read",
and gives the three cases as examples. TestMessagesUnreadableQuery
covers the 10,000-part case.
Model: opus-5-5
This commit is contained in:
@@ -152,6 +152,7 @@ func TestMessagesCount(t *testing.T) {
|
||||
|
||||
// TestMessagesUnreadableQuery: a query that cannot be decoded is refused
|
||||
// with a sentence that says so, whether or not the bad part is count.
|
||||
// The last query has 10,001 parts, more than Go's url.ParseQuery takes.
|
||||
func TestMessagesUnreadableQuery(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -159,6 +160,7 @@ func TestMessagesUnreadableQuery(t *testing.T) {
|
||||
|
||||
for _, query := range []string{
|
||||
"?count=1%", "?count=5&x=%zz", "?x=%zz", "?count=5;x=1",
|
||||
"?count=5" + strings.Repeat("&", 10000),
|
||||
} {
|
||||
client := &fakeClient{contacts: oneChat()}
|
||||
rec := request(t, newAPI(credential, client),
|
||||
|
||||
Reference in New Issue
Block a user