1*6777b538SAndroid Build Coastguard Worker# Copyright 2015 The Chromium Authors 2*6777b538SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be 3*6777b538SAndroid Build Coastguard Worker# found in the LICENSE file. 4*6777b538SAndroid Build Coastguard Worker# 5*6777b538SAndroid Build Coastguard Worker# Add a Strict-Transport-Security header to the response. 6*6777b538SAndroid Build Coastguard Worker 7*6777b538SAndroid Build Coastguard Worker 8*6777b538SAndroid Build Coastguard Workerimport json 9*6777b538SAndroid Build Coastguard Worker 10*6777b538SAndroid Build Coastguard Worker 11*6777b538SAndroid Build Coastguard Workerdef web_socket_do_extra_handshake(request): 12*6777b538SAndroid Build Coastguard Worker request.extra_headers.append( 13*6777b538SAndroid Build Coastguard Worker ('Strict-Transport-Security', 'max-age=3600')) 14*6777b538SAndroid Build Coastguard Worker pass 15*6777b538SAndroid Build Coastguard Worker 16*6777b538SAndroid Build Coastguard Worker 17*6777b538SAndroid Build Coastguard Workerdef web_socket_transfer_data(request): 18*6777b538SAndroid Build Coastguard Worker # Wait for closing handshake 19*6777b538SAndroid Build Coastguard Worker request.ws_stream.receive_message() 20