// $Id: ApacheWO+Echo2.m,v 1.1 2004/06/14 15:02:00 helge Exp $ #include "ApacheWO.h" #include "AWODirectoryConfig.h" #include "ApacheResourceManager.h" #include "WORequest+Apache.h" #include "WOResponse+Apache.h" #include #include "common.h" @implementation ApacheWO(Echo2Handler) - (WOResponse *)echoResponseForRequest:(WORequest *)woRequest apacheRequest:(ApacheRequest *)_rq config:(id)cfg { WOResponse *woResponse; [self logWithFormat:@"generated response was .."]; woResponse = [[[WOResponse alloc] initWithRequest:woRequest] autorelease]; /* construct response */ [woResponse setHeader:@"text/html" forKey:@"content-type"]; [woResponse appendContentString:@"

WOResponse Content

"]; [woResponse appendContentHTMLString:[cfg stringValue]]; [woResponse appendContentString:@"
\n\n"]; [woResponse appendContentString:@"URI:
"];
  [woResponse appendContentHTMLString:[woRequest uri]];
  [woResponse appendContentString:@"
\n"]; [woResponse appendContentString:@"Description:
"];
  [woResponse appendContentHTMLString:[woRequest description]];
  [woResponse appendContentString:@"
\n"]; [woResponse appendContentString:@"Request Headers:
"];
  [woResponse appendContentHTMLString:[[woRequest headers] description]];
  [woResponse appendContentString:@"
\n"]; [woResponse appendApacheResponseInfo: [_rq subRequestLookupURI:@"/docs/subdir/test.wox"]]; [woResponse appendContentString:@"
"]; [woResponse appendApacheResponseInfo: [_rq subRequestLookupFile:@"test.wox"]]; [woResponse appendContentString:@"
"]; [woResponse appendApacheResponseInfo: [_rq subRequestLookupURI:@"/docs/subdir/non_existent.wox"]]; [woResponse appendContentString:@"
"]; [woResponse appendApacheResponseInfo: [_rq subRequestLookupURI:@"/docs/subdir/"]]; [woResponse appendContentString:@"
"]; [woResponse appendApacheResponseInfo: [_rq subRequestLookupURI:@"/docs/bigimg.gif"]]; [woResponse appendContentString:@"
"]; return woResponse; } @end /* ApacheWO(Echo2Handler) */