~garritfra/taurus

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH taurus] Infer gemini:// scheme in the URL

Details
Message ID
<20201112144005.30173-1-yerinalexey98fd@gmail.com>
DKIM signature
pass
Download raw message
Patch: +4 -0
Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
---
 src/main.rs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/main.rs b/src/main.rs
index 86d899b..ed34ed8 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -135,6 +135,10 @@ fn handle_client(mut stream: TlsStream<TcpStream>, static_root: &str) -> TaurusR
        .map_err(TaurusError::StreamReadFailed)?;

    let mut raw_request = String::from_utf8_lossy(&buffer[..]).into_owned();

    if raw_request.starts_with("//") {
        raw_request = format!("gemini:{}", raw_request);
    }
    if !raw_request.starts_with("gemini://") {
        raw_request = format!("gemini://{}", raw_request);
    }
-- 
2.29.2

[taurus/patches/ci.yml] build success

builds.sr.ht
Details
Message ID
<C71D4FX0264B.3NH4UF14HJ1UV@cirno2>
In-Reply-To
<20201112144005.30173-1-yerinalexey98fd@gmail.com> (view parent)
DKIM signature
missing
Download raw message
taurus/patches/ci.yml: SUCCESS in 1m58s

[Infer gemini:// scheme in the URL][0] from [Alexey Yerin][1]

[0]: https://lists.sr.ht/~garritfra/taurus/patches/14951
[1]: yerinalexey98fd@gmail.com

✓ #340407 SUCCESS taurus/patches/ci.yml https://builds.sr.ht/~garritfra/job/340407
Details
Message ID
<CAD16O84-jL3wRUGt7ONQyGtzdJD5AmheSiG2gCznrc5QXq-epA@mail.gmail.com>
In-Reply-To
<20201112144005.30173-1-yerinalexey98fd@gmail.com> (view parent)
DKIM signature
pass
Download raw message
> +    if raw_request.starts_with("//") {
> +        raw_request = format!("gemini:{}", raw_request);
> +    }
>      if !raw_request.starts_with("gemini://") {
>          raw_request = format!("gemini://{}", raw_request);
>      }

I think a match would be better in this case. Then, we can also fix
more complex requests. Also, since we have CI now, could you write
some tests for this?
Details
Message ID
<20201112152208.rhzqdrinvn6wzoda@arch>
In-Reply-To
<CAD16O84-jL3wRUGt7ONQyGtzdJD5AmheSiG2gCznrc5QXq-epA@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
> Also, since we have CI now, could you write some tests for this?

Of course
Reply to thread Export thread (mbox)