Re: Cloning from sites with 404 overridden
- From
Junio C Hamano <junkio@cox.net>
- Date
- Mar 22, 2006, 19:05 UTC
- Message-ID
- <7vslpa8fld.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20060322183621.GP3997@reactrix.com>
Nick Hengeveld <nickh@reactrix.com> writes:
Show 5 quoted lines
> Some HTTP server environments return a 200 status and text/html error > document or a redirect to one rather than a 404 status if a loose > object does not exist. This patch detects and reports this condition > to differentiate between a misconfigured server and an actual corrupt > object on the server.
Show 11 quoted lines
> 61069cc348640fef2b8c503b8b8f00f689872cab > diff --git a/http-fetch.c b/http-fetch.c > index dc67218..ee5b585 100644 > --- a/http-fetch.c > +++ b/http-fetch.c > @@ -41,6 +41,7 @@ struct object_request > CURLcode curl_result; >... > + char *content_type; > unsigned char real_sha1[20]; >...
You probably need only one bit here,...
Show 9 quoted lines
> @@ -258,9 +259,15 @@ static void finish_object_request(struct > > static void process_object_response(void *callback_data) >... > + curl_easy_getinfo(obj_req->slot->curl, CURLINFO_CONTENT_TYPE, > + &content_type); > + if (content_type) > + obj_req->content_type = strdup(content_type); > +
... and note if that is an HTML document or not.
We do bend backwards to support ISP HTTP servers, but this might be going a bit too far. Also I wonder if ISP runs a really dumb-friendly configured server that defaults to text/html unless the mimemap says otherwise. Loose object files do not have suffixes and I am expecting these servers would give whatever the server default is.