Skip to content

Commit 665344a

Browse files
committed
Draft 75 handshake header Origin will be auto generated if not specified to match spec
1 parent 63fdd69 commit 665344a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/net/tootallnate/websocket/drafts/Draft_75.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ public List<Framedata> createFrames( String text, boolean mask ) {
8484
public HandshakeBuilder postProcessHandshakeRequestAsClient( HandshakeBuilder request ) throws InvalidHandshakeException {
8585
request.put( "Upgrade", "WebSocket" );
8686
request.put( "Connection", "Upgrade" );
87+
if(!request.hasFieldValue( "Origin" )){
88+
request.put( "Origin", "random"+new Random().nextInt() );
89+
}
90+
8791
return request;
8892
}
8993

0 commit comments

Comments
 (0)