From eb162a00874c0bbd48fafadd17416670101ab1a2 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 13 Nov 2022 09:17:43 +0800 Subject: [PATCH] chore: rename prefix to `/go` --- extension/manifest.json | 4 ++-- server/acl.go | 2 +- web/src/components/ShortcutListView.tsx | 2 +- web/src/router/index.tsx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extension/manifest.json b/extension/manifest.json index 14df5b2..a28a7a1 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -4,7 +4,7 @@ "version": "0.0.1", "manifest_version": 3, "omnibox": { - "keyword": "o/" + "keyword": "go/" }, "action": { "default_popup": "popup.html" @@ -14,5 +14,5 @@ "type": "module" }, "permissions": ["tabs", "activeTab", "storage"], - "host_permissions": ["*://o/*"] + "host_permissions": ["*://go/*"] } diff --git a/server/acl.go b/server/acl.go index 06892de..b3e4ad7 100644 --- a/server/acl.go +++ b/server/acl.go @@ -104,7 +104,7 @@ func aclMiddleware(s *Server, next echo.HandlerFunc) echo.HandlerFunc { } } - if common.HasPrefixes(path, "/o/:shortcutName", "/api/workspace/:workspaceName/shortcut/:shortcutName") && c.Request().Method == http.MethodGet { + if common.HasPrefixes(path, "/go/:shortcutName", "/api/workspace/:workspaceName/shortcut/:shortcutName") && c.Request().Method == http.MethodGet { return next(c) } diff --git a/web/src/components/ShortcutListView.tsx b/web/src/components/ShortcutListView.tsx index 38124f4..77a95e3 100644 --- a/web/src/components/ShortcutListView.tsx +++ b/web/src/components/ShortcutListView.tsx @@ -26,7 +26,7 @@ const ShortcutListView: React.FC = (props: Props) => { const handleCopyButtonClick = (shortcut: Shortcut) => { const workspace = workspaceService.getWorkspaceById(workspaceId); - copy(`${location.host}/${workspace?.name}/o/${shortcut.name}`); + copy(`${location.host}/${workspace?.name}/go/${shortcut.name}`); }; const handleEditShortcutButtonClick = (shortcut: Shortcut) => { diff --git a/web/src/router/index.tsx b/web/src/router/index.tsx index 6c469db..238290c 100644 --- a/web/src/router/index.tsx +++ b/web/src/router/index.tsx @@ -62,7 +62,7 @@ const router = createBrowserRouter([ }, }, { - path: "/:workspaceName/o/:shortcutName", + path: "/:workspaceName/go/:shortcutName", element: , loader: async () => { try {