itchio / butler

🎩 Command-line itch.io helper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistent behavior regarding whitespace in API key

kbieganski opened this issue · comments

If the user specifies the API key with leading/trailing whitespace, Butler is able to push an initial build to a given target. However, during an update push, it fails with the following message:

searching for parent build signature: opening signature: htfs.Open (initial request): in conn.Connect, non-retriable error: in conn.tryConnect, got HTTP non-2XX: api.itch.io: HTTP 403: {"errors":["invalid key"]}

Seems the pushing code itself is able to deal with the whitespace (possibly by trimming it), but that does not happen for build signature retrieval.

This behavior is inconsistent and quite confusing, and there was at least one more person that encountered this issue almost two years ago (that thread is archived now). I think the whitespace should always either be trimmed or cause an error.