Skip to content
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

Document ClientBuilder #9

Merged
merged 1 commit into from
Sep 5, 2023
Merged

Document ClientBuilder #9

merged 1 commit into from
Sep 5, 2023

Conversation

mercxry
Copy link
Contributor

@mercxry mercxry commented Sep 3, 2023

Hello 👋,

Thanks for the library! I'm building a small side-project to automatically manage my emails with custom rules (Sieve rules are not advanced enough), and since I'm using a provider that has a JMAP API this library seems to come in handy.

While I was trying to build a PoC, I noticed that there isn't much documentation for how the library works, so I thought I'd contribute a little bit while I was learning how to use it by looking at the code 🙂.

Let me know if there is anything incorrect, I tried my best to document as much as possible regarding the ClientBuilder, I might have misunderstood some cases since I'm not very familiar with the JMAP RFCs. Hopefully this helps a bit with issue #2 as well 😄.

@@ -120,6 +172,7 @@ impl ClientBuilder {
self
}

/// Set the originating IP address of the client connecting to the JMAP API.
pub fn forwarded_for(mut self, forwarded_for: IpAddr) -> Self {
self.forwarded_for = Some(match forwarded_for {
IpAddr::V4(addr) => format!("for={}", addr),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, shouldn't the header name be X-Forwarded-For instead of for?

Or does the JMAP RFC specify something different? 🤔
Couldn't find anything by quickly searching in it.

@mdecimus mdecimus merged commit 5b6595e into stalwartlabs:main Sep 5, 2023
1 check passed
@mdecimus
Copy link
Member

mdecimus commented Sep 5, 2023

Thanks, it has been merged.

@mercxry mercxry deleted the add-docs-clientbuilder branch September 5, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants