1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 14:58:08 +00:00

Use 204 return code for deleted sessions (#5541)

This commit is contained in:
yubiuser 2024-01-27 22:05:09 +01:00 committed by GitHub
commit cc8f9fe057
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -113,9 +113,8 @@ DeleteSession() {
deleteResponse=$(curl -skS -o /dev/null -w "%{http_code}" -X DELETE "${API_URL}auth" -H "Accept: application/json" -H "sid: ${SID}")
case "${deleteResponse}" in
"200") printf "%b" "A session that was not created cannot be deleted (e.g., empty API password).\n";;
"204") printf "%b" "Session successfully deleted.\n";;
"401") printf "%b" "Logout attempt without a valid session. Unauthorized!\n";;
"410") printf "%b" "Session successfully deleted.\n";;
esac;
fi