~garritfra/taurus

Trim 0x0 characters & display error message v1 APPLIED

Alexey Yerin: 1
 Trim 0x0 characters & display error message

 2 files changed, 2 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~garritfra/taurus/patches/14948/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] Trim 0x0 characters & display error message Export this patch

Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
---
 src/error.rs  | 2 +-
 src/gemini.rs | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/error.rs b/src/error.rs
index 6fddb4c..f2910be 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -14,7 +14,7 @@ pub enum TaurusError {
    #[error("failed parse certificate: {0:#?}")]
    InvalidCertificate(#[from] native_tls::Error),

    #[error("invalid request")]
    #[error("invalid request: {0}")]
    InvalidRequest(String),

    #[error("failed to bind: {0}")]
diff --git a/src/gemini.rs b/src/gemini.rs
index fa723fe..9963012 100644
--- a/src/gemini.rs
+++ b/src/gemini.rs
@@ -29,6 +29,7 @@ impl FromStr for GeminiRequest {
    fn from_str(s: &str) -> TaurusResult<Self> {
        // Extract and parse the url from the request.
        let raw = s
            .trim_end_matches(0x0 as char)
            .strip_suffix("\r\n")
            .ok_or_else(|| TaurusError::InvalidRequest("malformed request".into()))?;
        let url = Url::parse(&raw)
-- 
2.29.2