anchor.diff:  wait_response({gun_response, _Pid, _StreamRef, fin, StatusCode, Headers},
                 #{from := From} = State) ->
       gen_fsm:reply(From, #{status_code => StatusCode, headers => Headers}),
  -    {next_state, open_state, State};
  +    {next_state, at_rest, State};
   wait_response({gun_response, _Pid, _StreamRef, nofin, StatusCode, Headers}, State) ->
       StateName = case lists:keyfind(<<"transfer-encoding">>, 1, Headers) of
                       {<<"transfer-encoding">>, <<"chunked">>} ->
  
positive.code:                           headers => Headers,
                            body => NewData
                           }),
      {next_state, open_state, State};
  receive_data({gun_error, _Pid, StreamRef, _Reason},
               #{stream := StreamRef} = State) ->
      {next_state, open_state, State}.
  
  %% chunked data response
  receive_chunk({'DOWN', _, _, _, _Reason}, _State) ->
  
negative.code: receive_chunk({gun_data, _Pid, _StreamRef, fin, Data},
                #{responses := Responses} = State) ->
      NewResponses = queue:in(Data, Responses),
      {next_state, at_rest, State#{responses => NewResponses}};
  receive_chunk({gun_error, _Pid, _StreamRef, _Reason}, State) ->
      {next_state, at_rest, State}.
  
  %% internal
  clean_state() ->
  