anchor.diff:                 end,
       {IsAuthorized, S1, C1} = controller_call(is_authorized, State, Context1),
       case IsAuthorized of
  -        true -> 
  +        true ->
               d(v3b7, S1, C1);
  +        false ->
  +            CtxAuth = cowmachine_req:set_resp_header(<<"www-authenticate">>, <<"z.auth">>, C1),
  +            respond(401, S1, CtxAuth);
  +        AuthHead when is_binary(AuthHead) ->
  +            CtxAuth = cowmachine_req:set_resp_header(<<"www-authenticate">>, AuthHead, C1),
  +            respond(401, S1, CtxAuth);
           {error, Reason} ->
               error_response(Reason, S1, C1);
           {halt, Code}  ->
  -            respond(Code, S1, C1);
  -        AuthHead ->
  -            CtxAuth = cowmachine_req:set_resp_header(<<"www-authenticate">>, AuthHead, C1),
  -            respond(401, S1, CtxAuth)
  +            respond(Code, S1, C1)
       end;
   
   %% "Forbidden?"
  
positive.code: 
  -export([handle_request/2]).
  
  -include("cowmachine_state.hrl").
  
  handle_request(#cmstate{ controller = Controller } = CmState, Context) ->
  
negative.code:                                     ExpCtx0)
              end,
              {StateExp, ExpCtx};
          % Let the error controller handle 4xx and 5xx errors
          E when E >= 400, E =< 599 ->
              controller_call(finish_request, State, Context),
              throw({stop_request, Code});
          _ ->
              {State, Context}
      end,
      % Set transfer encoding.
      {State2, Context2} = case cowmachine_req:get_req_header(<<"te">>, Context1) of
          undefined -> {State1, Context1};
          TEHdr -> choose_transfer_encoding(TEHdr, State1, Context1)
      end,
      Context3 = cowmachine_req:set_response_code(Code, Context2),
      controller_call(finish_request, State2, Context3).
  
  respond(Code, Headers, State, Context) ->
      ContextHs = cowmachine_req:set_resp_headers(Headers, Context),
  