Remove downloadable Redirector config
This commit is contained in:
parent
7e927469dc
commit
48204b039b
2 changed files with 1 additions and 56 deletions
|
@ -1,6 +1,7 @@
|
||||||
2022-09-24
|
2022-09-24
|
||||||
|
|
||||||
* Replace Redirector extension with LibRedirect
|
* Replace Redirector extension with LibRedirect
|
||||||
|
* Remove downloadable Redirector config
|
||||||
|
|
||||||
2022-07-19
|
2022-07-19
|
||||||
|
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
class RedirectionConfig::Index < Lucky::Action
|
|
||||||
include Lucky::ProtectFromForgery
|
|
||||||
include Lucky::EnforceUnderscoredRoute
|
|
||||||
include Lucky::SecureHeaders::DisableFLoC
|
|
||||||
|
|
||||||
default_format :json
|
|
||||||
|
|
||||||
get "/redirection_config" do
|
|
||||||
data(
|
|
||||||
data: config_json,
|
|
||||||
content_type: "application/json",
|
|
||||||
disposition: "attachment",
|
|
||||||
filename: "redirector-config.json"
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
private def config_json
|
|
||||||
double_escaped_pattern = "^https?://(?:.*\\\\.)*(?<!(link\\\\.|cdn\\\\-images\\\\-\\\\d+\\\\.))medium\\\\.com(/.*)?$"
|
|
||||||
<<-JSON
|
|
||||||
{
|
|
||||||
"createdBy": "Redirector v3.5.3",
|
|
||||||
"createdAt": "2022-07-17T00:00:00.000Z",
|
|
||||||
"redirects": [
|
|
||||||
{
|
|
||||||
"description": "Medium -> Scribe",
|
|
||||||
"exampleUrl": "https://medium.com/@user/post-123456abcdef",
|
|
||||||
"exampleResult": "https://#{app_domain}/@user/post-123456abcdef",
|
|
||||||
"error": null,
|
|
||||||
"includePattern": "#{double_escaped_pattern}",
|
|
||||||
"excludePattern": "",
|
|
||||||
"patternDesc": "",
|
|
||||||
"redirectUrl": "https://#{app_domain}$2",
|
|
||||||
"patternType": "R",
|
|
||||||
"processMatches": "noProcessing",
|
|
||||||
"disabled": false,
|
|
||||||
"grouped": false,
|
|
||||||
"appliesTo": [
|
|
||||||
"main_frame",
|
|
||||||
"sub_frame",
|
|
||||||
"xmlhttprequest",
|
|
||||||
"history",
|
|
||||||
"other"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
JSON
|
|
||||||
end
|
|
||||||
|
|
||||||
private def app_domain
|
|
||||||
URI.parse(Home::Index.url).normalize
|
|
||||||
.to_s
|
|
||||||
.sub(/\/$/, "")
|
|
||||||
.sub(/^https?:\/\//, "")
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in a new issue