anchor.diff:  
   %% Detect the mimetype of the file.
   
  --spec content_types_provided(Req, State)
  -			    -> {[{binary(), get_file}], Req, State}
  -				   when State::state().
  +-spec content_types_provided(cowboy_req:req(), state())
  +			    -> {[{binary(), get_file}], cowboy_req:req(), state()}.
   content_types_provided(Req, State={Path, _, _}) ->
       {[{cow_mimetypes:all(Path), get_file}], Req, State}.
   
   %% Assume the resource doesn't exist if it's not a regular file.
   
  --spec resource_exists(Req, State) -> {boolean(), Req, State} when State::state().
  +-spec resource_exists(cowboy_req:req(), state()) -> {boolean(), cowboy_req:req(), state()}.
   resource_exists(Req, State={_, {ok, #file_info{type=regular}}, _}) ->
       {true, Req, State};
   resource_exists(Req, State) ->
  
positive.code: %% Reject requests that tried to access a file outside
  %% the target directory.
  
  -spec malformed_request(Req, State)
  		       -> {boolean(), Req, State}.
  malformed_request(Req, State) ->
      {State =:= error, Req, State}.
  
  
  -spec is_authorized(Req, State) -> {true, Req, State} | {{false, binary()}, Req, State}.
  is_authorized(Req, State) ->
      {true, Req, State}.
  
  %% Directories, files that can't be accessed at all and
  %% files with no read flag are forbidden.
  
  -spec forbidden(Req, State)
  	       -> {boolean(), Req, State}
  		      when State::state().
  forbidden(Req, State={_, {ok, #file_info{type=directory}}, _}) ->
      {true, Req, State};
  forbidden(Req, State={_, {error, eacces}, _}) ->
  
negative.code: 
  %% Return the time of last modification of the file.
  
  -spec last_modified(cowboy_req:req(), state()) -> {calendar:datetime(), cowboy_req:req(), state()}.
  last_modified(Req, State={_, {ok, #file_info{mtime=Modified}}, _}) ->
      {Modified, Req, State}.
  
  %% Stream the file.
  %% @todo Export cowboy_req:resp_body_fun()?
  
  -spec get_file(cowboy_req:req(), state()) -> {{stream, non_neg_integer(), fun()}, cowboy_req:req(), state()}.
  get_file(Req, State={Path, {ok, #file_info{size=Size}}, _}) ->
      Sendfile = fun (Socket, Transport) ->
  		       case Transport:sendfile(Socket, Path) of
  