-
Notifications
You must be signed in to change notification settings - Fork 1
Add configurable generic_alert APNs payload mode #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JeroenOnNostr
wants to merge
1
commit into
marmot-protocol:master
Choose a base branch
from
JeroenOnNostr:feat/generic-alert-payload-mode
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🌐 Web query:
Does http crate HeaderValue::from_str reject carriage return and line feed characters?💡 Result:
Yes, the http crate's HeaderValue::from_str method rejects carriage return (CR, ASCII 13) and line feed (LF, ASCII 10) characters [1][2]. The method validates input to ensure it contains only visible ASCII characters, which are defined as the range 32–127 [3][1]. Since both carriage return (13) and line feed (10) fall outside this permitted range of visible ASCII characters, they are considered invalid, and attempting to create a HeaderValue containing them via from_str will return an error [3][1]. The official documentation explicitly includes examples showing that passing a string with a newline character results in an error [1][2].
Citations:
🏁 Script executed:
Repository: marmot-protocol/transponder
Length of output: 14679
🏁 Script executed:
Repository: marmot-protocol/transponder
Length of output: 6356
🌐 Web query:
reqwest RequestBuilder header invalid HeaderValue returns error build send semantics💡 Result:
In the reqwest library, the RequestBuilder maintains an internal Result state to handle configuration errors, including those that occur when adding invalid headers [1]. When you call the.header method on a RequestBuilder, it attempts to convert the provided key and value into a HeaderName and HeaderValue using TryFrom [2][1]. If the value provided is invalid (for example, containing restricted characters like CR, LF, or NUL [3]), this conversion returns an InvalidHeaderValue error [4][5]. Because RequestBuilder uses an internal mechanism to accumulate errors, providing an invalid header does not cause an immediate panic or return an error at the exact line where.header is called [1]. Instead, the error is stored within the RequestBuilder [1]. The error is surfaced only when you attempt to finalize or execute the request: 1. build: When you call.build, it consumes the RequestBuilder and returns a Result<Request, Error>. If a previous header configuration failed, this result will contain the error [1]. 2. send: When you call.send, it internally calls build. If the build process fails due to a stored error (such as an InvalidHeaderValue), the send method will return an error, preventing the request from being dispatched [1]. In summary, invalid header values do not interrupt the builder chain immediately; they "poison" the builder's internal state, and the resulting error is surfaced during the final build or send operation [1].
Citations:
httpCrate seanmonstar/reqwest#2094Validate
apns.collapse_idas a header value tooThe length guard is good, but
collapse_idis later passed toreqwest::RequestBuilder::header(). If it contains CR/LF or another invalid byte, the builder becomes invalid andbuild()/send()returns anErrfor every APNs notification. Rejecting invalid header values here would fail fast at startup, just like the other config checks.🤖 Prompt for AI Agents