Skip to content

Show Unauthorized warnings only in debug mode#2005

Merged
DL6ER merged 1 commit into
development-v6from
tweak/api_warnings_debug
Jul 3, 2024
Merged

Show Unauthorized warnings only in debug mode#2005
DL6ER merged 1 commit into
development-v6from
tweak/api_warnings_debug

Conversation

@DL6ER

@DL6ER DL6ER commented Jul 1, 2024

Copy link
Copy Markdown
Member

What does this implement/fix?

Log API Unauthorized warnings caused by send_json_error() only if debug.api is true.


Related issue or feature (if applicable): N/A

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories developmental branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

@DL6ER DL6ER requested a review from a team July 1, 2024 15:38
@DL6ER DL6ER changed the title Log API warnings caused by send_json_error() only if debug.api is true Show Unauthorized warnings only in debug mode Jul 1, 2024
@pralor-bot

Copy link
Copy Markdown

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/api-unauthorized-warning-in-ftl-log-when-logging-out/70967/6

@DL6ER DL6ER force-pushed the tweak/api_warnings_debug branch from ec0b4e8 to c089121 Compare July 1, 2024 18:07
Comment thread src/api/config.c Outdated
@DL6ER DL6ER force-pushed the tweak/api_warnings_debug branch from c089121 to 73d5827 Compare July 2, 2024 01:40
@yubiuser

yubiuser commented Jul 2, 2024

Copy link
Copy Markdown
Member

And now that the value defaults to true all the time we could also just hard-code it. Or do you want to keep the flexibility to set it to false at some point in the future?

@DL6ER

DL6ER commented Jul 3, 2024

Copy link
Copy Markdown
Member Author

The key is that it isn't always true. Check out send_json_unauthorized() where it is indeed conditional.

@DL6ER DL6ER merged commit 5c97d29 into development-v6 Jul 3, 2024
@DL6ER DL6ER deleted the tweak/api_warnings_debug branch July 3, 2024 15:54
@PromoFaux PromoFaux mentioned this pull request Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants