Conversation
| val path = settings.baseUrl.getOrElse(context.getContextPath) | ||
| Seq( | ||
| ".*/(?!.*(signin|dashboard|admin)).+/.+" -> s""" | ||
| "(?!/(?:signin|dashboard|admin)(?:/|$)).+/.+" -> s""" |
There was a problem hiding this comment.
I understand the current problem that the explorer plugin doesn't work for repositories that contain /signin, /dashboard and /admin. However, this change could wrongly inject CSS/JavaScript when GitBucket is installed under the context path.
Maybe we should include the context path in the regular expression?
There was a problem hiding this comment.
@takezoe the further commit should handle context path too.
There's also an alternative PR , #73 (kind of a "hack" ) since that place is not optimal, however this way no regexp is needed, since it will be inserted only where needed.
However, IMO a better solution would be to allow plug-ins to handle assets better (but that would require some GitHub changes: please see https://github.com/aadrian/gitbucket-explorer-plugin/wiki/Plugin-asset-extension-point
Thank you.
Fixes the URL-matching regex so repositories named
signin,dashboard,adminorgroupswork, and anchors it after the servlet context path as suggested in the review. AddsPluginSpec.