File tree 3 files changed +5
-9
lines changed
3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -520,5 +520,5 @@ export function escapeHtml(unsafe: string): string {
520
520
. replace ( / < / g, "<" )
521
521
. replace ( / > / g, ">" )
522
522
. replace ( / " / g, """ )
523
- . replace ( / ' / g, "' ;" )
523
+ . replace ( / ' / g, "&apos ;" )
524
524
}
Original file line number Diff line number Diff line change @@ -448,8 +448,8 @@ describe("onLine", () => {
448
448
449
449
describe ( "escapeHtml" , ( ) => {
450
450
it ( "should escape HTML" , ( ) => {
451
- expect ( util . escapeHtml ( `<div class="error">"Hello & world"</div>` ) ) . toBe (
452
- "<div class="error">"Hello & world"</div>" ,
451
+ expect ( util . escapeHtml ( `<div class="error">"'ello & world"</div>` ) ) . toBe (
452
+ "<div class="error">"'ello & world"</div>" ,
453
453
)
454
454
} )
455
455
} )
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