File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,15 @@ export default class CanvasServer {
33 this . room = room ;
44 }
55
6+ onRequest ( req ) {
7+ return new Response ( null , {
8+ headers : {
9+ "X-Frame-Options" : "ALLOWALL" ,
10+ "Content-Security-Policy" : "frame-ancestors *" ,
11+ } ,
12+ } ) ;
13+ }
14+
615 async onConnect ( connection ) {
716 const strokes = ( await this . room . storage . get ( "strokes" ) ) || [ ] ;
817 connection . send ( JSON . stringify ( { type : "init" , strokes } ) ) ;
@@ -22,11 +31,9 @@ export default class CanvasServer {
2231
2332 async onClose ( connection ) {
2433 const connections = [ ...this . room . getConnections ( ) ] ;
25-
2634 if ( connections . length === 0 ) {
2735 await this . room . storage . put ( "strokes" , [ ] ) ;
2836 }
29-
3037 this . broadcast ( { type : "users" , count : connections . length } ) ;
3138 }
3239
You can’t perform that action at this time.
0 commit comments