summary refs log tree commit diff
path: root/path.go
diff options
context:
space:
mode:
authorMelonai <einebeere@gmail.com>2021-07-26 21:52:58 +0200
committerMelonai <einebeere@gmail.com>2021-07-26 21:53:36 +0200
commit0ac82c133b78a14239beb9034380c44d95d4bad3 (patch)
tree3ba65b4e3e5ceafaf2180ea697cc7794a07da669 /path.go
parent7819a23171145e8a626e8357e88446817c8785dc (diff)
downloadportgate-0ac82c133b78a14239beb9034380c44d95d4bad3.tar.zst
portgate-0ac82c133b78a14239beb9034380c44d95d4bad3.zip
Portgate pages and templates
Diffstat (limited to 'path.go')
-rw-r--r--path.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/path.go b/path.go
index 3aa7816..82a8353 100644
--- a/path.go
+++ b/path.go
@@ -68,3 +68,13 @@ func ParsePathFromReferer(p Path, r string) (Path, error) {
 		ResourcePath:          p.ResourcePath,
 	}, nil
 }
+
+// IsPortgatePath returns whether the Path goes to Portgate.
+func (p *Path) IsPortgatePath() bool {
+	return p.DestinationIdentifier == -1 && strings.HasPrefix(p.ResourcePath, "/_portgate")
+}
+
+// IsPortgateStaticPath returns whether the Path goes to the Portgate static files.
+func (p *Path) IsPortgateStaticPath() bool {
+	return p.DestinationIdentifier == -1 && strings.HasPrefix(p.ResourcePath, "/_portgate/static")
+}