mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
fix(amp): add /docs routes to proxy
This commit is contained in:
@@ -126,7 +126,7 @@ func (m *AmpModule) registerManagementRoutes(engine *gin.Engine, baseHandler *ha
|
|||||||
var authWithBypass gin.HandlerFunc
|
var authWithBypass gin.HandlerFunc
|
||||||
if auth != nil {
|
if auth != nil {
|
||||||
ampAPI.Use(auth)
|
ampAPI.Use(auth)
|
||||||
authWithBypass = wrapManagementAuth(auth, "/threads", "/auth")
|
authWithBypass = wrapManagementAuth(auth, "/threads", "/auth", "/docs")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dynamic proxy handler that uses m.getProxy() for hot-reload support
|
// Dynamic proxy handler that uses m.getProxy() for hot-reload support
|
||||||
@@ -175,7 +175,11 @@ func (m *AmpModule) registerManagementRoutes(engine *gin.Engine, baseHandler *ha
|
|||||||
if authWithBypass != nil {
|
if authWithBypass != nil {
|
||||||
rootMiddleware = append(rootMiddleware, authWithBypass)
|
rootMiddleware = append(rootMiddleware, authWithBypass)
|
||||||
}
|
}
|
||||||
|
engine.GET("/threads", append(rootMiddleware, proxyHandler)...)
|
||||||
engine.GET("/threads/*path", append(rootMiddleware, proxyHandler)...)
|
engine.GET("/threads/*path", append(rootMiddleware, proxyHandler)...)
|
||||||
|
engine.GET("/docs", append(rootMiddleware, proxyHandler)...)
|
||||||
|
engine.GET("/docs/*path", append(rootMiddleware, proxyHandler)...)
|
||||||
|
|
||||||
engine.GET("/threads.rss", append(rootMiddleware, proxyHandler)...)
|
engine.GET("/threads.rss", append(rootMiddleware, proxyHandler)...)
|
||||||
engine.GET("/news.rss", append(rootMiddleware, proxyHandler)...)
|
engine.GET("/news.rss", append(rootMiddleware, proxyHandler)...)
|
||||||
|
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ func (s *FileTokenStore) baseDirSnapshot() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DEPRECATED: Use metadataEqualIgnoringTimestamps for comparing auth metadata.
|
// DEPRECATED: Use metadataEqualIgnoringTimestamps for comparing auth metadata.
|
||||||
// This function is kept for backward compatibility but can cause refresh loops.
|
// This function is kept for backward compatibility but can cause refresh loops.
|
||||||
func jsonEqual(a, b []byte) bool {
|
func jsonEqual(a, b []byte) bool {
|
||||||
var objA any
|
var objA any
|
||||||
var objB any
|
var objB any
|
||||||
|
|||||||
Reference in New Issue
Block a user