aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNoPlagiarism <37241775+NoPlagiarism@users.noreply.github.com>2023-07-16 23:50:24 +0500
committerNoPlagiarism <37241775+NoPlagiarism@users.noreply.github.com>2023-07-16 23:50:24 +0500
commitddceb0454a12e878ab4b663f78756ead65e078a4 (patch)
tree0d5333938c83fe325046a5ad7bef1f3d0749783c /src
parent[GotHub] Add GitHub gists support (diff)
downloadlibredirect-ddceb0454a12e878ab4b663f78756ead65e078a4.zip
[GotHub] Remove /file/ path
Diffstat (limited to '')
-rw-r--r--src/assets/javascripts/services.js8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index dd8ea7ac..e0b7b6df 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -493,14 +493,6 @@ function redirect(url, type, initiator, forceRedirection) {
return
}
case "gothub": {
- const regex = /^\/(.*)\/(.*)\/(?:blob|tree)\/(.*)\/(.*)/.exec(url.pathname)
- if (regex) {
- const user = regex[1]
- const repo = regex[2]
- const branch = regex[3]
- const path = regex[4]
- return `${randomInstance}/file/${user}/${repo}/${branch}/${path}`
- }
if (url.hostname == "gist.github.com") return `${randomInstance}/gist${url.pathname}${url.search}`
return `${randomInstance}${url.pathname}${url.search}`
}