{"action":"created","issue":{"url":"https://api.github.com/repos/curl/curl/issues/783","repository_url":"https://api.github.com/repos/curl/curl","labels_url":"https://api.github.com/repos/curl/curl/issues/783/labels{/name}","comments_url":"https://api.github.com/repos/curl/curl/issues/783/comments","events_url":"https://api.github.com/repos/curl/curl/issues/783/events","html_url":"https://github.com/curl/curl/pull/783","id":151607649,"number":783,"title":"curl: add --suppress-proxy-headers","user":{"login":"dochang","id":129093,"avatar_url":"https://avatars.githubusercontent.com/u/129093?v=3","gravatar_id":"","url":"https://api.github.com/users/dochang","html_url":"https://github.com/dochang","followers_url":"https://api.github.com/users/dochang/followers","following_url":"https://api.github.com/users/dochang/following{/other_user}","gists_url":"https://api.github.com/users/dochang/gists{/gist_id}","starred_url":"https://api.github.com/users/dochang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dochang/subscriptions","organizations_url":"https://api.github.com/users/dochang/orgs","repos_url":"https://api.github.com/users/dochang/repos","events_url":"https://api.github.com/users/dochang/events{/privacy}","received_events_url":"https://api.github.com/users/dochang/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/curl/curl/labels/HTTP","name":"HTTP","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-04-28T10:45:40Z","updated_at":"2016-05-13T19:12:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/curl/curl/pulls/783","html_url":"https://github.com/curl/curl/pull/783","diff_url":"https://github.com/curl/curl/pull/783.diff","patch_url":"https://github.com/curl/curl/pull/783.patch"},"body":"Based on this [discussion][1].\r\n\r\n[1]: http://thread.gmane.org/gmane.comp.web.curl.general/14958/focus=15014\r\n"},"comment":{"url":"https://api.github.com/repos/curl/curl/issues/comments/219134284","html_url":"https://github.com/curl/curl/pull/783#issuecomment-219134284","issue_url":"https://api.github.com/repos/curl/curl/issues/783","id":219134284,"user":{"login":"jay","id":965580,"avatar_url":"https://avatars.githubusercontent.com/u/965580?v=3","gravatar_id":"","url":"https://api.github.com/users/jay","html_url":"https://github.com/jay","followers_url":"https://api.github.com/users/jay/followers","following_url":"https://api.github.com/users/jay/following{/other_user}","gists_url":"https://api.github.com/users/jay/gists{/gist_id}","starred_url":"https://api.github.com/users/jay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jay/subscriptions","organizations_url":"https://api.github.com/users/jay/orgs","repos_url":"https://api.github.com/users/jay/repos","events_url":"https://api.github.com/users/jay/events{/privacy}","received_events_url":"https://api.github.com/users/jay/received_events","type":"User","site_admin":false},"created_at":"2016-05-13T19:12:40Z","updated_at":"2016-05-13T19:12:40Z","body":"Another way we could go which may be better is work off of his commit but make sure that suppressing the headers means they're suppressed from reaching *both* user callbacks. The option wouldn't have anything to do with CURLOPT_HEADER and instead just be a separate option to prevent the headers from being received by the callbacks. Like this:\r\n~~~diff\r\ndiff --git a/lib/http_proxy.c b/lib/http_proxy.c\r\nindex 546dd43..24dc4ba 100644\r\n--- a/lib/http_proxy.c\r\n+++ b/lib/http_proxy.c\r\n@@ -368,10 +368,11 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,\r\n                                line_start, (size_t)perline, conn);\r\n\r\n                   /* send the header to the callback */\r\n-                  writetype = CLIENTWRITE_HEADER;\r\n-                  if(data->set.include_header &&\r\n-                     !data->set.suppress_connect_headers)\r\n-                    writetype |= CLIENTWRITE_BODY;\r\n+                  if(!data->set.suppress_connect_headers) {\r\n+                    writetype = CLIENTWRITE_HEADER;\r\n+                    if(data->set.include_header)\r\n+                      writetype |= CLIENTWRITE_BODY;\r\n+                  }\r\n\r\n                   result = Curl_client_write(conn, writetype, line_start,\r\n                                              perline);\r\n~~~\r\n\r\nAlso I think some of his documentation (even if it's adjusted for the behavior above) is superfluous, we really don't need a lot of it. It should be shorter and to the point, it could be as simple as 'When this option is enabled proxytunnel headers will not be sent to the user's writefunction and header function.'\r\n\r\nAnother idea compatible with that is change the option to suppress_headers and then flags for proxytunnel and server and we default to none. That way the user could suppress server headers if they wanted only the proxy tunnel headers for some reason."}}