~edwardloveall/scribe

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

[PATCH] Fix viewing articles if the URL has a trailing slash

Details
Message ID
<20221030151245.16865-1-blankie@nixnetmail.com>
DKIM signature
missing
Download raw message
Patch: +1 -1
---
Where I saw a URL with a trailing slash in the wild:
https://adamsilver.io/blog/the-disadvantages-of-single-page-applications/#14.-they-just-don%E2%80%99t-feel-right

 src/classes/article_id_parser.cr | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/classes/article_id_parser.cr b/src/classes/article_id_parser.cr
index 8693ea6..1db19de 100644
--- a/src/classes/article_id_parser.cr
+++ b/src/classes/article_id_parser.cr
@@ -1,7 +1,7 @@
class ArticleIdParser
  include Monads

  ID_REGEX = /[\/\-]([0-9a-f]+)$/i
  ID_REGEX = /[\/\-]([0-9a-f]+)\/?$/i

  def self.parse(request : HTTP::Request)
    new.parse(request)
-- 
2.38.1
Details
Message ID
<779E266A-A362-4C77-BC71-40DBFC1EAEF7@edwardloveall.com>
In-Reply-To
<20221030151245.16865-1-blankie@nixnetmail.com> (view parent)
DKIM signature
missing
Download raw message
Thank you for finding this and submitting a patch. I merged it as-is and deployed it today. Sorry for such a delay.

Edward

On 30 Oct 2022, at 11:12, blankie wrote:

> ---
> Where I saw a URL with a trailing slash in the wild:
> https://adamsilver.io/blog/the-disadvantages-of-single-page-applications/#14.-they-just-don%E2%80%99t-feel-right
>
>  src/classes/article_id_parser.cr | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/classes/article_id_parser.cr b/src/classes/article_id_parser.cr
> index 8693ea6..1db19de 100644
> --- a/src/classes/article_id_parser.cr
> +++ b/src/classes/article_id_parser.cr
> @@ -1,7 +1,7 @@
>  class ArticleIdParser
>    include Monads
>
> -  ID_REGEX = /[\/\-]([0-9a-f]+)$/i
> +  ID_REGEX = /[\/\-]([0-9a-f]+)\/?$/i
>
>    def self.parse(request : HTTP::Request)
>      new.parse(request)
> -- 
> 2.38.1
Reply to thread Export thread (mbox)