mirror of
https://git.sr.ht/~edwardloveall/scribe
synced 2025-12-10 12:41:23 +00:00
Fix article ID parsing bug
Since the article ID regular expression wasn't anchored to the end of the URL, it would grab characters after a / or - that were hex characters. For example /@user/bacon-123abc would just grab `bac`. Not great. This anchors the ID at the end of the string so that it will be more likely to catch IDs.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user