发布

  • Fix Tavily search depth dropdown showing 'undefined' values (#1088)

    frostbyte_neo 发布于 2025-11-18 23:02:16 +00:00

    • Fix Tavily search depth dropdown showing 'undefined' values

    The select dropdown rendering code assumed all options were objects with
    .value and .label properties. However, some settings (like Tavily's
    search_depth) store options as simple string arrays ["basic", "advanced"].

    This caused the dropdown to display "undefined" and send invalid values
    to the Tavily API, resulting in HTTP 400 Bad Request errors.

    Updated the code to handle both formats:

    • String arrays: ["basic", "advanced"]
    • Object arrays: [{value: "basic", label: "Basic"}]

    Fixes #1086

    • chore: auto-bump version to 1.2.15

    • Fix XSS vulnerability and improve performance in settings dropdown

    Security fix:

    • Added escapeHtml function to prevent XSS attacks
    • Escape both optionValue and optionLabel before inserting into HTML
    • Addresses AI Code Review security concerns from PR #1088

    Performance improvement:

    • Use array.join() instead of string concatenation in loop
    • More efficient for rendering multiple dropdown options

    The settings dropdown now safely handles both string and object
    option formats while protecting against potential injection attacks.


    Co-authored-by: GitHub Action action@github.com

    下载附件