File tree Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -521,5 +521,5 @@ export function escapeHtml(unsafe: string): string {
521
521
. replace ( / < / g, "<" )
522
522
. replace ( / > / g, ">" )
523
523
. replace ( / " / g, """ )
524
- . replace ( / ' / g, "' ;" )
524
+ . replace ( / ' / g, "&apos ;" )
525
525
}
Original file line number Diff line number Diff line change @@ -437,8 +437,8 @@ describe("onLine", () => {
437
437
438
438
describe ( "escapeHtml" , ( ) => {
439
439
it ( "should escape HTML" , ( ) => {
440
- expect ( util . escapeHtml ( `<div class="error">"Hello & world"</div>` ) ) . toBe (
441
- "<div class="error">"Hello & world"</div>" ,
440
+ expect ( util . escapeHtml ( `<div class="error">"'ello & world"</div>` ) ) . toBe (
441
+ "<div class="error">"'ello & world"</div>" ,
442
442
)
443
443
} )
444
444
} )
Original file line number Diff line number Diff line change @@ -60,18 +60,14 @@ describe("login", () => {
60
60
process . env . PASSWORD = previousEnvPassword
61
61
} )
62
62
63
- it ( "should return escaped HTML with 'Missing password' message" , async ( ) => {
63
+ it ( "should return HTML with 'Missing password' message" , async ( ) => {
64
64
const resp = await codeServer ( ) . fetch ( "/login" , { method : "POST" } )
65
65
66
66
expect ( resp . status ) . toBe ( 200 )
67
67
68
68
const htmlContent = await resp . text ( )
69
69
70
- expect ( htmlContent ) . not . toContain ( ">" )
71
- expect ( htmlContent ) . not . toContain ( "<" )
72
- expect ( htmlContent ) . not . toContain ( '"' )
73
- expect ( htmlContent ) . not . toContain ( "'" )
74
- expect ( htmlContent ) . toContain ( "<div class="error">Missing password</div>" )
70
+ expect ( htmlContent ) . toContain ( "Missing password" )
75
71
} )
76
72
} )
77
73
} )
You can’t perform that action at this time.
0 commit comments