Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit565fd78

Browse files
committed
fix: escape ampersand and question mark in ProxyCommand
Fixes#479.
1 parent16b9788 commit565fd78

File tree

1 file changed

+4
-2
lines changed
  • src/main/kotlin/com/coder/gateway/util

1 file changed

+4
-2
lines changed

‎src/main/kotlin/com/coder/gateway/util/Escape.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ fun escape(s: String): String {
1212
if (s.contains("\n")) {
1313
throwException("argument cannot contain newlines")
1414
}
15-
if (s.contains("")|| s.contains("\t")) {
16-
return"\""+ s.replace("\"","\\\"")+"\""
15+
if (s.contains("")|| s.contains("\t")|| s.contains("&")|| s.contains("?")) {
16+
// See https://github.com/coder/jetbrains-coder/issues/479
17+
// Escape existing " and &
18+
return"\""+ s.replace("\"","\\\"").replace("&","\\&").replace("?","\\?")+"\""
1719
}
1820
return s.replace("\"","\\\"")
1921
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp