Update Ghostgram features

This commit is contained in:
ichmagmaus 812
2026-03-07 18:15:32 +01:00
parent 1a3303b059
commit 24a7ec39d9
902 changed files with 148295 additions and 62348 deletions
@@ -0,0 +1,17 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
swift_library(
name = "SGActionRequestHandlerSanitizer",
module_name = "SGActionRequestHandlerSanitizer",
srcs = glob([
"Sources/**/*.swift",
]),
copts = [
"-warnings-as-errors",
],
deps = [
],
visibility = [
"//visibility:public",
],
)
@@ -0,0 +1,15 @@
import Foundation
public func sgActionRequestHandlerSanitizer(_ url: URL) -> URL {
var url = url
if let scheme = url.scheme {
let openInPrefix = "\(scheme)://parseurl?url="
let urlString = url.absoluteString
if urlString.hasPrefix(openInPrefix) {
if let unwrappedUrlString = String(urlString.dropFirst(openInPrefix.count)).removingPercentEncoding, let newUrl = URL(string: unwrappedUrlString) {
url = newUrl
}
}
}
return url
}