mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #819 from omnivore-app/fix/medium-handler
Fix detection of medium subdomains
This commit is contained in:
commit
99a39ed150
1 changed files with 1 additions and 4 deletions
|
|
@ -10,10 +10,7 @@ const os = require('os');
|
|||
exports.mediumHandler = {
|
||||
|
||||
shouldPrehandle: (url, env) => {
|
||||
const MEDIUM_URL_MATCH =
|
||||
/https?:\/\/(www\.)?medium.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/
|
||||
const res = MEDIUM_URL_MATCH.test(url.toString())
|
||||
return res
|
||||
return u.hostname.endsWith('medium.com')
|
||||
},
|
||||
|
||||
prehandle: async (url, env) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue