* GSWeb/GSWComponentRequestHandler.m

* GSWeb/GSWComponent.m
        * GSWeb/GSWConstants.[h|m]
        * GSWeb/GSWFileUpload.m
        * GSWeb/GSWRequest.m
        * GSWeb/GSWResourceRequestHandler.m
        * GSWeb/GSWResponse.m
        introduce some new string constants to GSWConstants
        and use them more consistently


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@36743 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
buzzdee 2013-06-22 16:00:13 +00:00
parent b87aa5a799
commit 0e263dd5a5
10 changed files with 37 additions and 18 deletions

View file

@ -1,3 +1,14 @@
2013-06-22: Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
* GSWeb/GSWComponentRequestHandler.m
* GSWeb/GSWComponent.m
* GSWeb/GSWConstants.[h|m]
* GSWeb/GSWFileUpload.m
* GSWeb/GSWRequest.m
* GSWeb/GSWResourceRequestHandler.m
* GSWeb/GSWResponse.m
introduce some new string constants to GSWConstants
and use them more consistently
2013-06-12: David Wetzel <dave@turbocat.de>
* GSWAdaptors/Apache2/mod_gsw.c
use strncasecmp to be more tolerant with header case

View file

@ -1306,7 +1306,7 @@ Call this method before using a component which was cached in a variable.
[response setHTTPVersion:httpVersion];
[response setHeader:@"text/html"
forKey:@"Content-Type"];
forKey:GSWHTTPHeader_ContentType];
[aContext _setResponse:response];
pageElement=[aContext _pageElement];

View file

@ -160,7 +160,7 @@ GSWResponse * _dispatchWithPreparedPage(GSWComponent * aPage, GSWSession * aSess
[aResponse setHTTPVersion:[aRequest httpVersion]];
[aResponse setHeader:@"text/html"
forKey:@"Content-Type"];
forKey:GSWHTTPHeader_ContentType];
[aContext _setResponse:aResponse];
if (oldContextID == nil) {

View file

@ -143,6 +143,7 @@ GSWEB_EXPORT NSString* GSWHTTPHeader_RecordingIDsCookie[2];
GSWEB_EXPORT NSString* GSWHTTPHeader_RecordingApplicationNumber[2];
GSWEB_EXPORT NSString* GSWHTTPHeader_LoadAverage;
GSWEB_EXPORT NSString* GSWHTTPHeader_RefuseSessions;
GSWEB_EXPORT NSString* GSWHTTPHeader_RefusingRedirection[2];
// Header key to return statistics to Adaptor
GSWEB_EXPORT NSString* GSWHTTPHeader_AdaptorStats[2];
@ -152,8 +153,11 @@ GSWEB_EXPORT NSString* GSWHTTPHeader_MethodPost;
GSWEB_EXPORT NSString* GSWHTTPHeader_MethodGet;
GSWEB_EXPORT NSString* GSWHTTPHeader_AcceptLanguage;
GSWEB_EXPORT NSString* GSWHTTPHeader_AcceptEncoding;
GSWEB_EXPORT NSString* GSWHTTPHeader_ContentDisposition;
GSWEB_EXPORT NSString* GSWHTTPHeader_ContentEncoding;
GSWEB_EXPORT NSString* GSWHTTPHeader_ContentType;
GSWEB_EXPORT NSString* GSWHTTPHeader_FormURLEncoded;
GSWEB_EXPORT NSString* GSWHTTPHeader_Location;
GSWEB_EXPORT NSString* GSWHTTPHeader_MultipartFormData;
GSWEB_EXPORT NSString* GSWHTTPHeader_ContentLength;
GSWEB_EXPORT NSString* GSWHTTPHeader_MimeType_TextPlain;

View file

@ -142,14 +142,18 @@ NSString* GSWHTTPHeader_RecordingIDsCookie[2]={ @"x-gsweb-ids-url", @"x-webobjec
NSString* GSWHTTPHeader_RecordingApplicationNumber[2]={ @"x-gsweb-application-number", @"x-webobjects-application-number" };
NSString* GSWHTTPHeader_LoadAverage = @"x-webobjects-loadaverage";
NSString* GSWHTTPHeader_RefuseSessions = @"x-webobjects-refusenewsessions";
NSString* GSWHTTPHeader_RefusingRedirection[2] = { @"x-gsweb-refusing-redirection", @"x-webobjects-refusing-redirection" };
NSString* GSWHTTPHeader_AdaptorStats[2] = { @"x-gsweb-adaptorstats", @"x-webobjects-adaptorstats" };
NSString* GSWHTTPHeader_MethodPost=@"POST";
NSString* GSWHTTPHeader_MethodGet=@"GET";
NSString* GSWHTTPHeader_AcceptLanguage=@"Accept-Language";
NSString* GSWHTTPHeader_AcceptEncoding=@"Accept-Encoding";
NSString* GSWHTTPHeader_ContentDisposition=@"Content-Disposition";
NSString* GSWHTTPHeader_ContentEncoding=@"Content-Encoding";
NSString* GSWHTTPHeader_ContentType=@"Content-Type";
NSString* GSWHTTPHeader_FormURLEncoded=@"application/x-www-form-urlencoded";
NSString* GSWHTTPHeader_Location=@"Location";
NSString* GSWHTTPHeader_MultipartFormData=@"multipart/form-data";
NSString* GSWHTTPHeader_MimeType_TextPlain=@"text/plain";
NSString* GSWHTTPHeader_UserAgent=@"User-Agent";

View file

@ -182,7 +182,7 @@ RCS_ID("$Id$")
nameInContext=[self nameInContext:context];
fileNameFormValueName = [NSString stringWithFormat:@"%@.filename", nameInContext];
mimeValueName = [NSString stringWithFormat:@"%@.%@",nameInContext, @"content-type"];
mimeValueName = [NSString stringWithFormat:@"%@.%@",nameInContext, GSWHTTPHeader_ContentType];
fileDatas = [request formValuesForKey:nameInContext];

View file

@ -1639,7 +1639,7 @@ RCS_ID("$Id$")
@"Document is not a GSMimeDocument but a %@:\n%@",
[aDoc class],aDoc);
aDocContent=[aDoc content];
contentDispositionHeader=[aDoc headerNamed:@"content-disposition"];
contentDispositionHeader=[aDoc headerNamed:GSWHTTPHeader_ContentDisposition];
contentDispositionValue=[contentDispositionHeader value];
contentDispositionParams=[contentDispositionHeader parameters];
@ -1671,7 +1671,7 @@ RCS_ID("$Id$")
paramFormValueName = [NSString stringWithFormat:@"%@.%@",formDataName,paramName];
previous = [formValues objectForKey:paramFormValueName];
typeFormValueName = [NSString stringWithFormat:@"%@.%@",formDataName, @"content-type"];
typeFormValueName = [NSString stringWithFormat:@"%@.%@",formDataName, GSWHTTPHeader_ContentType];
prevContentType = [formValues objectForKey:typeFormValueName];
contentType = [NSString stringWithFormat:@"%@/%@",

View file

@ -206,7 +206,7 @@ NSLog(@"dateString is %@", dateString);
if (contentType)
{
[aResponse setHeader:contentType
forKey:@"Content-Type"];
forKey:GSWHTTPHeader_ContentType];
}

View file

@ -243,9 +243,9 @@ void GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(GSWResponse*
GSWResponse_appendContentString(self, content);
[self setStatus:302];
[self setHeader:location
forKey:@"Location"];
forKey:GSWHTTPHeader_Location];
[self setHeader:@"YES"
forKey:@"x-webobjects-refusing-redirection"];
forKey:GSWHTTPHeader_RefusingRedirection[1]];
}
@ -293,8 +293,8 @@ void GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(GSWResponse*
// it does not make sense to compress data less than 150 bytes.
if ((dataLength > 150) && ([self _browserSupportsCompression:[aContext request]]))
{
NSString* contentType=[self headerForKey:@"Content-Type"];
NSString* contentEncoding=[self headerForKey:@"Content-Encoding"];
NSString* contentType=[self headerForKey:GSWHTTPHeader_ContentType];
NSString* contentEncoding=[self headerForKey:GSWHTTPHeader_ContentEncoding];
if ((contentEncoding) || (!compressableContentTypesCache)) {
return;
@ -322,7 +322,7 @@ void GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(GSWResponse*
[self setContent:compressedData];
dataLength=[self _contentLength];
[self setHeader:@"gzip"
forKey:@"Content-Encoding"];
forKey:GSWHTTPHeader_ContentEncoding];
}
}
}
@ -475,7 +475,7 @@ escapingHTMLAttributeValue:(BOOL)escape
if (httpVersion)
[aResponse setHTTPVersion:httpVersion];
[aResponse setHeader:@"text/html"
forKey:@"Content-Type"];
forKey:GSWHTTPHeader_ContentType];
[aContext _setResponse:aResponse];
responseString=[NSString stringWithFormat:@"<HTML>\n<TITLE>GNUstepWeb Error</TITLE>\n</HEAD>\n<BODY bgcolor=\"white\">\n<CENTER>\n%@\n</CENTER>\n</BODY>\n</HTML>\n",
GSWResponse_stringByEscapingHTMLString(aResponse,aMessage)];
@ -544,18 +544,18 @@ escapingHTMLAttributeValue:(BOOL)escape
GSWResponse_appendContentString(self,message);
[self setHeader:GSWIntToNSString([[self content] length])
forKey:@"content-length"];
forKey:GSWHTTPHeader_ContentLength];
};
if (isDefinitive)
[self setStatus:301]; // redirect definitive !
else
[self setStatus:302]; // redirect temporary !
[self setHeader:location
forKey:@"Location"];
forKey:GSWHTTPHeader_Location];
[self setHeader:@"text/html"
forKey:@"Content-Type"];
forKey:GSWHTTPHeader_ContentType];
[self setHeader:@"YES"
forKey:@"x-gsweb-refusing-redirection"];
forKey:GSWHTTPHeader_RefusingRedirection[0]];
}
//--------------------------------------------------------------------

View file

@ -224,10 +224,10 @@ static Class NSStringClass = Nil;
else
[response setContent:data];
[response setHeader:GSWIntToNSString((int)[data length])
forKey:@"Content-Length"];
forKey:GSWHTTPHeader_ContentLength];
[response setHeader:_mimeType
forKey:@"Content-Type"];
forKey:GSWHTTPHeader_ContentType];
};
//--------------------------------------------------------------------