--- ncat_proxy.c.orig 2011-10-03 11:50:01.564672269 +0200 +++ ncat_proxy.c 2011-10-03 11:37:05.124672612 +0200 @@ -124,8 +124,8 @@ /* * Simple forking HTTP proxy. It is an HTTP/1.0 proxy with knowledge of * HTTP/1.1. (The things lacking for HTTP/1.1 are the chunked transfer encoding - * and the expect mechanism.) The proxy supports the CONNECT, GET, HEAD, and - * POST methods. It supports Basic authentication of clients (use the + * and the expect mechanism.) The proxy supports the CONNECT, GET, HEAD, POST, + * and OPTIONS methods. It supports Basic authentication of clients (use the * --proxy-auth option). * * HTTP/1.1 is defined in RFC 2616. Many comments refer to that document. @@ -237,7 +237,8 @@ return strcmp(method, "CONNECT") == 0 || strcmp(method, "GET") == 0 || strcmp(method, "HEAD") == 0 - || strcmp(method, "POST") == 0; + || strcmp(method, "POST") == 0 + || strcmp(method, "OPTIONS") == 0; } static void http_server_handler(int c) @@ -332,7 +333,8 @@ code = handle_connect(&sock, &request); } else if (strcmp(request.method, "GET") == 0 || strcmp(request.method, "HEAD") == 0 - || strcmp(request.method, "POST") == 0) { + || strcmp(request.method, "POST") == 0 + || strcmp(request.method, "OPTIONS") == 0) { code = handle_method(&sock, &request); } else { code = 500; @@ -441,7 +443,7 @@ static int do_transaction(struct http_request *request, struct socket_buffer *client_sock, struct socket_buffer *server_sock); -/* Generic handler for GET, HEAD, and POST methods. */ +/* Generic handler for GET, HEAD, POST, and OPTIONS methods. */ static int handle_method(struct socket_buffer *client_sock, struct http_request *request) { @@ -498,7 +500,7 @@ return 0; } -/* Do a GET, HEAD, or POST transaction. */ +/* Do a GET, HEAD, POST, or OPTIONS transaction. */ static int do_transaction(struct http_request *request, struct socket_buffer *client_sock, struct socket_buffer *server_sock) { @@ -663,7 +665,7 @@ /* RFC 2616, section 14.7 for Allow. */ return "\ HTTP/1.0 405 Method Not Allowed\r\n\ -Allow: CONNECT, GET, HEAD, POST\r\n\ +Allow: CONNECT, GET, HEAD, POST, OPTIONS\r\n\ \r\n"; case 407: return "\