anchor.diff:          {http, {Id, stream_start, Headers}} ->
               ?LOG(info, "Serving stream: ~s", [Url]),
               % snag the content-length and content-type headers:
  -            Headers1 = [ { "content-type", 
  -                           proplists:get_value("content-type", Headers, 
  -                                               "binary/unknown-not-specified")} ],
  -            Headers2 = case proplists:get_value("content-length", Headers) of
  -                undefined -> Headers1;
  -                Len -> [ {"content-length", Len} | Headers1 ]
  -            end,
  -            Pid ! {Ref, headers, Headers2},
  -            start_streaming(Id, Pid, Ref);
  +            ContentType = proplists:get_value("content-type", Headers, 
  +                                             "binary/unknown-not-specified"),
  +            ContentLength = proplists:get_value("content-length", Headers),
  +            % some results from web indexes to audio files have expired and
  +            % just give you an html response that says bugger off:
  +            case string:str(ContentType, "text/html") of
  +                0 ->
  +                    Headers1 = [ { "content-type", ContentType } ],
  +                    Headers2 = case ContentLength of
  +                        undefined -> Headers1;
  +                        Len -> [ {"content-length", Len} | Headers1 ]
  +                    end,
  +                    ?LOG(info, "starting stream, type: ~s size: ~s", [ContentType, ContentLength]),
  +                    Pid ! {Ref, headers, Headers2},
  +                    start_streaming(Id, Pid, Ref);
  +                _ ->
  +                    ?LOG(warning, "Got content type of ~s - aborting, probably failed.", [ContentType]),
  +                    Pid ! {Ref, error, "Suspicious content type header"}
  +            end;
               
           {http, {Id, error, Reason}} ->
               ?LOG(warning, "HTTP req failed for ~s",[Url]),
  
positive.code: -include_lib("kernel/include/file.hrl").
  
  -define(HTTP_HEADERS_TIMEOUT, 5000).
  
  -export([start_link/3, reader_protocols/0]).
  
  
negative.code:             
          {http, {Id, stream_end, _Headers}} ->
              Pid ! {Ref, eof}
      
      after ?HTTP_STREAM_TIMEOUT ->
              ?LOG(warning, "Timeout receiving stream", []),
              Pid ! {Ref, error, timeout}
      end.
  
  