

def handle_options(self, handle, connection, match, data, hdr):
    ' Handle HTTP OPTIONS requests\n        '
    response = 'HTTP/1.1 200 OK\n'
    ' Copy the content of Access-Control-Request-Headers to the response\n        '
    if ('access-control-request-headers' in hdr):
        response += (('Access-Control-Allow-Headers: ' + match['access-control-request-headers']) + '\n')
    response += 'Content-Length: 0\nAccess-Control-Allow-Origin: *\nAccess-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\nContent-Type: *\n\n\r\n'
    if (connection is None):
        msg = {
            'cmd': 'httpresp',
            'msgid': handle,
            'header': response,
            'data': None,
        }
        self.tunnel_client.send(msg)
    else:
        connection.send(response)

dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/runtime/north/calvincontrol.py CalvinControl.handle_options/VarMisuse@43/114 `hdr`->`match`