Repository navigation
fix: [Agent] The agent logo is not displayed on the web-accessible page as configured in the settings, and the browser tab title is incorrect. #7778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,10 +85,6 @@ chatRouter.beforeEach(async (to) => { | |
| return getLoginRoute(scope, to) | ||
| }) | ||
|
|
||
| chatRouter.afterEach((to) => { | ||
| document.title = to.meta.title ? `${to.meta.title} - MaxKB` : 'MaxKB' | ||
| }) | ||
|
|
||
| let isReauthenticating = false | ||
|
|
||
| /** | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Analysis of the Code DiffThe diff shows the removal of an // REMOVED CODE:
chatRouter.afterEach((to) => {
document.title = to.meta.title ? `${to.meta.title} - MaxKB` : 'MaxKB'
})Potential Issues with Removing This
Recommendations
Verdict
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's my review of the diff:
Potential Issues
Silent behavior change in
replace()(BUG)'<link rel="icon" href="./favicon.ico"/>'(no space before/>)'<link rel="icon" href="./favicon.ico" />'(space added)This is a meaningful change, not just formatting. If the actual HTML template contains
...favicon.ico"/>without the space, thestr.replace()will silently do nothing and the favicon won't be replaced. Whatever changed the string content should be treated as a functional change and verified against the real template. Revert if unintended.escape()output inserted into HTML attributesescape()(Django'sdjango.utils.html.escape) escapes< > & ' ", which is reasonable for attribute context. Butapplication_iconis placed inside anhref="...". Consider validating it's a safe URL scheme (e.g., rejectjavascript:), since escaping doesn't prevent scheme-based XSS on older browsers.white_listused unvalidated in CSP header" ".join(white_list)assumes a list of strings. If any entry is user-controlled, a value containing spaces/tokens could inject extra CSP directives. Validate each origin. Also, ifwhite_listis empty whilewhite_activeis True, you emitframe-ancestors(empty), which may block all framing — worth confirming that's intended.access_token.__contains__("/")— works, but"/" in access_tokenis more idiomatic and faster. Same for== "undefined"check; consider also handling empty string after strip.response.content.decode("utf-8")on non-HTML/binary responsesstartswith(chat_path), not/api) may still hit static assets (JS/CSS/images). Decoding arbitrary bytes as UTF-8 can raiseUnicodeDecodeError, crashing the response. Guard onContent-Typestarting withtext/htmlbefore decoding/replacing.Nonevs missing check forapplication_access_tokenget_application_access_token(..., True)semantics (cached=True?) — confirm caching TTL doesn't cause stale icon/name.Style / Minor
""everywhere, but the module docstring header keys (@project:, etc.) still use full-width colon:— cosmetic.# 添加自定义的响应头is Chinese; if the codebase standardizes on English comments, translate it..replace(...)chain is fine, but wrappingCONFIG.get_chat_path()in a local variable would avoid repeated calls and improve readability:Suggested Rewrite (key parts)
Bottom line: The main thing to verify is item #1 — the added space in the
favicon.icosearch string likely breaks the replacement. Everything else is defensive hardening / style.