Permalink
Browse files

https recorder: don't try to rewrite headers if the data is body only…

… (TSUN-133)

SVN Revision: 1061
  • Loading branch information...
1 parent f6acf9f commit 6a76ee8986ba088f9ac72d033281cfaea2025dd4 @nniclausse nniclausse committed Dec 11, 2009
Showing with 10 additions and 1 deletion.
  1. +4 −0 src/tsung/ts_utils.erl
  2. +6 −1 src/tsung_recorder/ts_proxy_http.erl
View
@@ -412,6 +412,10 @@ is_ip(_) -> false.
%%----------------------------------------------------------------------
to_https({url, "http://ssl-"++Rest})-> "https://" ++ Rest;
to_https({url, URL})-> URL;
+to_https({request, {body,Data}}) when is_list(Data) ->
+ %% body request, no headers
+ {ok,RealBody,_Count} = regexp:gsub(Data,"http://ssl-","https://"),
+ {ok, RealBody};
to_https({request, String}) when is_list(String) ->
EndOfHeader = string:str(String, "\r\n\r\n"),
Header = string:substr(String, 1, EndOfHeader - 1) ++ "\r\n",
@@ -124,7 +124,12 @@ parse(State=#proxy{parse_status=body, buffer=Http},_,ServerSocket,String) ->
?LOGF("HTTP Body size=~p ~n",[DataSize], ?DEB),
Size = State#proxy.body_size + DataSize,
CLength = State#proxy.content_length,
- ts_client_proxy:send(ServerSocket, String, ?MODULE),
+ case ServerSocket of
+ {sslsocket, _, _} ->
+ ts_client_proxy:send(ServerSocket, {body,String}, ?MODULE);
+ _ ->
+ ts_client_proxy:send(ServerSocket, String, ?MODULE)
+ end,
Buffer=lists:append(Http#http_request.body,String),
%% Should be checked before
case Size of

0 comments on commit 6a76ee8

Please sign in to comment.