feat(feeds): add opt-in Gecko relay and folder shortcuts
Document engine redistribution requirements; exclude upstream engine assets and keep the viewer disabled by default.
This commit is contained in:
1 parent
b23e63d4c6
commit
5321d613b4
37 files changed
+2051
-29
No files matched your search
@@ -19,7 +19,7 @@ func NormalizePath(
|
||||
// Hosted adapter assets use directory-relative module and worker URLs.
|
||||
// DAV collections also require the slash: removing it conflicts with
|
||||
// ServeMux's collection redirect and causes an infinite redirect loop.
|
||||
if strings.HasPrefix(p, "/_/adaptor/") || strings.HasPrefix(p, "/_/api/v1/caldav/") || strings.HasPrefix(p, "/_/api/v1/carddav/") {
|
||||
if strings.HasPrefix(p, "/_/adaptor/") || strings.HasPrefix(p, "/_/api/v1/caldav/") || strings.HasPrefix(p, "/_/api/v1/carddav/") || strings.HasPrefix(p, "/_/api/v1/extension/organizer.feeds/browser/") {
|
||||
next.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -24,3 +24,18 @@ func TestNormalizePathDAVCollections(t *testing.T) {
|
||||
t.Fatal("Wiki canonicalization changed", w.Code, w.Header())
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizePathGeckoWebsocket(t *testing.T) {
|
||||
for _, path := range []string{"/_/api/v1/extension/organizer.feeds/browser/", "/_/api/v1/extension/organizer.feeds/browser/wisp/"} {
|
||||
w := httptest.NewRecorder()
|
||||
NormalizePath(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != path {
|
||||
t.Fatal(r.URL.Path)
|
||||
}
|
||||
w.WriteHeader(401)
|
||||
})).ServeHTTP(w, httptest.NewRequest("GET", path, nil))
|
||||
if w.Code != 401 || w.Header().Get("Location") != "" {
|
||||
t.Fatal("redirected browser endpoint", w.Code)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user