url = [_ctx urlWithRequestHandlerKey:@"so" path:@"/" queryString:nil];
[_response setStatus:302 /* moved */];
[_response setHeader:url forKey:@"location"];
+ [self logWithFormat:@"URL: %@", url];
return;
}
- we are not really clever with DSoUserManager and DSoDatabaseManager,
those two classes are basically identical
+
+- the "GET" method is explicitly mapped in product.plist for the application
+ object because otherwise "GET" will be treated as a hostname (because we
+ perform no check on the hostname!)
+ - need to check whether we can make SOPE smarter on this front, but I guess
+ that issue is inherent to all containers which map to arbitary, external
+ collections
+ - we could create an EOAdaptor and connect it to 'template1', but this would
+ result in one unnecessary DB connection?
/* name lookup */
+- (BOOL)isHostName:(NSString *)_key inContext:(id)_ctx {
+ NSRange r;
+
+ r = [_key rangeOfString:@"."]; // TODO: this also catches IPs!
+ if (r.length > 0)
+ return NO;
+
+ return YES;
+}
+
- (id)lookupHost:(NSString *)_key inContext:(id)_ctx {
NSRange r;
NSString *hostName;
}
- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
- NSRange r;
id obj;
/* first check attributes directly bound to the application */
One way to check for a valid key would be to check whether the key is a
valid hostname, but I would like to avoid that for performance reasons.
+
+ Addition: we also get queries for various other methods, like "GET" if
+ no method was provided in the query path.
*/
- r = [_key rangeOfString:@"."];
- if (r.length == 0)
+ if ([self isHostName:_key inContext:_ctx])
return [self lookupHost:_key inContext:_ctx];
return nil;
protectedBy = "View";
pageName = "MainPage";
};
+ "GET" = { // more or less a hack, see README
+ protectedBy = "View";
+ pageName = "MainPage";
+ };
"connect" = {
protectedBy = "View";
pageName = "MainPage";