Skip to content

Commit 807c53f

Browse files
committed
Add /item route
This is just so clicking the extension name is not completely broken.
1 parent 4b5f654 commit 807c53f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

api/api.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ func New(options *Options) *API {
124124
// ignores the VSIX asset URL provided to VS Code in the response.
125125
r.Get("/publishers/{publisher}/vsextensions/{extension}/{version}/{type}", api.assetRedirect)
126126

127+
// This is the URL you get taken to when you click the extension's names,
128+
// ratings, etc from the extension details page.
129+
r.Get("/item", func(rw http.ResponseWriter, r *http.Request) {
130+
httpapi.WriteBytes(rw, http.StatusOK, []byte("Extension pages are not supported"))
131+
})
132+
127133
return api
128134
}
129135

api/api_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ func TestAPI(t *testing.T) {
245245
Status: http.StatusMovedPermanently,
246246
Response: "/files/publisher/extension/version/extension.vsix",
247247
},
248+
{
249+
Name: "Item",
250+
Path: "/item",
251+
Status: http.StatusOK,
252+
},
248253
}
249254

250255
extdir := filepath.Join(t.TempDir(), "extensions")

0 commit comments

Comments
 (0)