Skip to content

Potential fix for code scanning alert no. 3: Replacement of a substring with itself#113

Open
zeti1223 wants to merge 1 commit into
releasefrom
alert-autofix-3
Open

Potential fix for code scanning alert no. 3: Replacement of a substring with itself#113
zeti1223 wants to merge 1 commit into
releasefrom
alert-autofix-3

Conversation

@zeti1223

@zeti1223 zeti1223 commented Apr 7, 2026

Copy link
Copy Markdown
Member

Potential fix for https://github.com/cigoria/simpleShare/security/code-scanning/3

In general, a “replacement of a substring with itself” warning means either the replacement is pointless and should be removed, or there is a typo and the replacement should actually change the string (for example, adding or stripping a prefix). Here, since p.replace(/^\/admin/, '/admin') leaves the path unchanged, the cleanest fix without altering functionality is to remove the rewrite function so that the proxy simply forwards /admin paths as-is.

Concretely, in client/vite.config.js, within the server.proxy['/admin'] block, delete the rewrite property. The result will be:

'/admin': {
  target: backend,
  changeOrigin: true
}

No new imports or helper methods are needed; we are only simplifying the existing object literal.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…ng with itself

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@zeti1223 zeti1223 marked this pull request as ready for review April 7, 2026 18:10
@FonixPython FonixPython self-requested a review June 29, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant