sync - #1760
Merged
Merged
Conversation
Next release
The custom header added in #1695 was a single name/value pair, which is enough for a proxy that authenticates with one token but not for Pangolin, which expects both P-Access-Token-Id and P-Access-Token. NTFY_CUSTOMHEADER_NAME and NTFY_CUSTOMHEADER_VALUE are replaced by a single list setting, NTFY_CUSTOM_HEADERS, holding one "Name: Value" entry per header. The list widget is the same one the other list settings use. Only the first colon separates the name from the value, so values may contain colons. An entry is skipped and logged when it is malformed, when the name repeats, or when it collides with a header the plugin already set, so a custom header still cannot clobber the ntfy credentials. Values are never written to the log, since they are usually secrets. That also applies to the invalid-header error, which now names the headers that were applied without quoting any of them.
… tests Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
Theme was applied on raw $(document).ready, which fires before the async cacheSettings() call has necessarily populated the settings cache. clearCache() (the header reload button) wipes localStorage immediately before reloading, so that reload could read an empty cache and hard-override the theme to Light via setCookie, even with Dark or System configured. Gated the theme application on callAfterAppInitialized(), which is already used elsewhere for this class of race. Fixes #943
A custom header carrying a non-ASCII character raised UnicodeEncodeError from inside http.client. That is a ValueError, not a RequestException, so it escaped both handlers in send() and took the whole publisher down - every notification lost because of one typo in one header. build_custom_headers now rejects newlines and non-ASCII the same way it already rejects malformed and colliding entries: warn, skip that entry, keep the rest. UnicodeEncodeError is still caught at the request, as a backstop for the plugin's own headers, since REPORT_DASHBOARD_URL feeds one of them. Verified against real requests: before, send() raised UnicodeEncodeError; after, the bad header is dropped and the notification is still posted.
The whitespace note contradicted itself: it said surrounding whitespace is trimmed and then that leading or trailing whitespace is invalid. The parser strips, so trimming is what actually happens. Also lists the new non-ASCII/newline skip reason and states that skipping is per entry, and adds the language identifier markdownlint wants on the two fenced blocks (MD040).
…t-failure fix: lazy-import write_notification to prevent partial module load in CI tests
…-headers feat(ntfy): allow more than one custom header
Fix: theme reverts to Light after header reload (#943)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.