]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commit - server/tests/cli/peertube.ts
(#3520) [cli] Hardened `auth add`: No longer fails with extraneous characters. 3521/head
authorTheodore R. Smith <theodore@phpexperts.pro>
Sun, 27 Dec 2020 15:13:11 +0000 (09:13 -0600)
committerTheodore R. Smith <theodore@phpexperts.pro>
Sun, 27 Dec 2020 20:29:54 +0000 (14:29 -0600)
commit8e76aa1d75aebdadd0451d2e57c9bb65d1e75b9a
tree3b9809e75c8e8f9044080182801f4516a11fe242
parentf88453e2335ec9140df927d3cca727d2a3a4ab70
(#3520) [cli] Hardened `auth add`: No longer fails with extraneous characters.

**The Solution:**
I have hardened `auth add` by stripping out everything from the third '/' to the end of the instance URL.

**The Problem:**
When adding an authorization for the peertube-cli, before this commit you could not have anything after the domain_name:port.

For instance, if there was a trailing / in your instance URL, before this commit it will always fail with

    expected 200 "OK", got 404 "Not Found".

It took me over 20 minutes to figure out that this was the problem.

See Issue #3091.
server/tests/cli/peertube.ts
server/tools/peertube-auth.ts