Permalink
Browse files

Fixed problem with creating a database through the HTTP listener

  • Loading branch information...
1 parent aeb415e commit 1fa16fc203a268c3bf2024df16b99a15c15111c3 @pegli pegli committed with snej Jan 9, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 Listener/TDHTTPConnection.m
@@ -79,8 +79,11 @@ - (BOOL)supportsMethod:(NSString *)method atPath:(NSString *)path {
- (BOOL)expectsRequestBodyFromMethod:(NSString *)method atPath:(NSString *)path {
- return $equal(method, @"POST") || $equal(method, @"PUT")
- || [super expectsRequestBodyFromMethod:method atPath:path];
+ if ($equal(method, @"PUT")) {
+ // Allow PUT to /newdbname without a request body.
+ return ! $equal([path stringByDeletingLastPathComponent], @"/");
+ }
+ return $equal(method, @"POST") || [super expectsRequestBodyFromMethod:method atPath:path];
}
- (void)prepareForBodyWithSize:(UInt64)contentLength {

0 comments on commit 1fa16fc

Please sign in to comment.