aboutsummaryrefslogtreecommitdiffstats
path: root/giphyproxy/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'giphyproxy/main.go')
-rw-r--r--giphyproxy/main.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/giphyproxy/main.go b/giphyproxy/main.go
index 279afcb..8954a46 100644
--- a/giphyproxy/main.go
+++ b/giphyproxy/main.go
@@ -22,6 +22,7 @@ import (
"fmt"
"os"
"regexp"
+ "time"
"go.mau.fi/util/exerrors"
"gopkg.in/yaml.v3"
@@ -53,6 +54,13 @@ func main() {
}
func getMedia(_ context.Context, id string) (response mediaproxy.GetMediaResponse, err error) {
+ // This is not related to giphy, but random cats are always fun
+ if id == "cat" {
+ return &mediaproxy.GetMediaResponseURL{
+ URL: "https://cataas.com/cat",
+ ExpiresAt: time.Now(),
+ }, nil
+ }
if !giphyIDRegex.MatchString(id) {
return nil, mediaproxy.ErrInvalidMediaIDSyntax
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage