Skip to content

Commit

Permalink
fix: error "Not authorized" when uploading archives
Browse files Browse the repository at this point in the history
The `persistentlogin=off` snippet in the request makes the server
to respond the cookie `persistentlogin`, which will then be send in the
POST `teleporter.php` request, which will cause the pihole server to
respond: "Not authorized" when this cookie is sent.

Removing this snippets from the login request removes the
`persistentlogin` from the response. Conesquently, the archive upload
is accepted by the pihole sever.
  • Loading branch information
Hazegard authored and mattwebbio committed Aug 5, 2024
1 parent 103155c commit c9eea45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/v5/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class ClientV5 {
headers: {
'content-type': 'application/x-www-form-urlencoded'
},
body: `pw=${encodeURIComponent(host.password)}&persistentlogin=off`,
body: `pw=${encodeURIComponent(host.password)}`,
method: 'POST'
});
if (response.status !== 200)
Expand Down

0 comments on commit c9eea45

Please sign in to comment.