aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes/lookup.php
diff options
context:
space:
mode:
authorwinter2025-04-04 20:23:19 +0100
committerwinter2025-04-04 20:23:19 +0100
commit1dff99922724fa9fb7da7e41f645197a312786cb (patch)
tree4784e4828521040a4955f3ec8e89a84b689fb4a3 /routes/lookup.php
parent44212e6248c93171ddedb51bfdb212ce8ffed695 (diff)
add web+pawpub support
Diffstat (limited to 'routes/lookup.php')
-rw-r--r--routes/lookup.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/routes/lookup.php b/routes/lookup.php
index 62d9e48..903c1b9 100644
--- a/routes/lookup.php
+++ b/routes/lookup.php
@@ -12,9 +12,12 @@ Router::getInstance()->mount('/lookup', function (array $args) {
throw new BadRequest('please provide a `uri` query parameter');
}
$uri = $_GET['uri'];
- if (!str_starts_with($uri, 'https://')) {
+ if (!(str_starts_with($uri, 'https://') || str_starts_with($uri, 'web+pawpub://'))) {
throw new BadRequest('dodgy looking uri');
}
+ if (str_starts_with($uri, 'web+pawpub://')) {
+ $uri = substr_replace($uri, 'https', 0, 10);
+ }
// try looking it up as a note
try {