diff --git a/GCDWebDAVServer/GCDWebDAVServer.h b/GCDWebDAVServer/GCDWebDAVServer.h index 4fc53a0..e6eda52 100644 --- a/GCDWebDAVServer/GCDWebDAVServer.h +++ b/GCDWebDAVServer/GCDWebDAVServer.h @@ -95,7 +95,7 @@ NS_ASSUME_NONNULL_BEGIN * * The default value is nil i.e. all file extensions are allowed. */ -@property(nonatomic, copy) NSArray* allowedFileExtensions; +@property(nonatomic, copy) NSArray* allowedFileExtensions; /** * Sets if files and directories whose name start with a period are allowed to diff --git a/GCDWebServer/Core/GCDWebServer.h b/GCDWebServer/Core/GCDWebServer.h index 59572ba..434aa71 100644 --- a/GCDWebServer/Core/GCDWebServer.h +++ b/GCDWebServer/Core/GCDWebServer.h @@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN * GCDWebServerRequest instance created with the same basic info. * Otherwise, it simply returns nil. */ -typedef GCDWebServerRequest* _Nullable (^GCDWebServerMatchBlock)(NSString* requestMethod, NSURL* requestURL, NSDictionary* requestHeaders, NSString* urlPath, NSDictionary* urlQuery); +typedef GCDWebServerRequest* _Nullable (^GCDWebServerMatchBlock)(NSString* requestMethod, NSURL* requestURL, NSDictionary* requestHeaders, NSString* urlPath, NSDictionary* urlQuery); /** * The GCDWebServerProcessBlock is called after the HTTP request has been fully @@ -365,7 +365,7 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess; * * Returns NO if the server failed to start and sets "error" argument if not NULL. */ -- (BOOL)startWithOptions:(nullable NSDictionary*)options error:(NSError** _Nullable)error; +- (BOOL)startWithOptions:(nullable NSDictionary*)options error:(NSError** _Nullable)error; /** * Stops the server and prevents it to accepts new HTTP requests. @@ -444,7 +444,7 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess; * * @warning This method must be used from the main thread only. */ -- (BOOL)runWithOptions:(nullable NSDictionary*)options error:(NSError** _Nullable)error; +- (BOOL)runWithOptions:(nullable NSDictionary*)options error:(NSError** _Nullable)error; #endif @@ -613,7 +613,7 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess; * * Returns the number of failed tests or -1 if server failed to start. */ -- (NSInteger)runTestsWithOptions:(nullable NSDictionary*)options inDirectory:(NSString*)path; +- (NSInteger)runTestsWithOptions:(nullable NSDictionary*)options inDirectory:(NSString*)path; @end diff --git a/GCDWebServer/Core/GCDWebServer.m b/GCDWebServer/Core/GCDWebServer.m index 20e0e28..5be19f6 100644 --- a/GCDWebServer/Core/GCDWebServer.m +++ b/GCDWebServer/Core/GCDWebServer.m @@ -141,14 +141,14 @@ static void _ExecuteMainThreadRunLoopSources() { @implementation GCDWebServer { dispatch_queue_t _syncQueue; dispatch_group_t _sourceGroup; - NSMutableArray* _handlers; + NSMutableArray* _handlers; NSInteger _activeConnections; // Accessed through _syncQueue only BOOL _connected; // Accessed on main thread only CFRunLoopTimerRef _disconnectTimer; // Accessed on main thread only - NSDictionary* _options; - NSMutableDictionary* _authenticationBasicAccounts; - NSMutableDictionary* _authenticationDigestAccounts; + NSDictionary* _options; + NSMutableDictionary* _authenticationBasicAccounts; + NSMutableDictionary* _authenticationDigestAccounts; Class _connectionClass; CFTimeInterval _disconnectDelay; dispatch_source_t _source4; @@ -408,7 +408,7 @@ static void _SocketCallBack(CFSocketRef s, CFSocketCallBackType type, CFDataRef } } -static inline id _GetOption(NSDictionary* options, NSString* key, id defaultValue) { +static inline id _GetOption(NSDictionary* options, NSString* key, id defaultValue) { id value = [options objectForKey:key]; return value ? value : defaultValue; } @@ -721,7 +721,7 @@ static inline NSString* _EncodeBase64(NSString* string) { #endif -- (BOOL)startWithOptions:(NSDictionary*)options error:(NSError**)error { +- (BOOL)startWithOptions:(NSDictionary*)options error:(NSError**)error { if (_options == nil) { _options = options ? [options copy] : @{}; #if TARGET_OS_IPHONE @@ -832,7 +832,7 @@ static inline NSString* _EncodeBase64(NSString* string) { return [self runWithOptions:options error:NULL]; } -- (BOOL)runWithOptions:(NSDictionary*)options error:(NSError**)error { +- (BOOL)runWithOptions:(NSDictionary*)options error:(NSError**)error { GWS_DCHECK([NSThread isMainThread]); BOOL success = NO; _run = YES; @@ -868,7 +868,7 @@ static inline NSString* _EncodeBase64(NSString* string) { } - (void)addDefaultHandlerForMethod:(NSString*)method requestClass:(Class)aClass asyncProcessBlock:(GCDWebServerAsyncProcessBlock)block { - [self addHandlerWithMatchBlock:^GCDWebServerRequest*(NSString* requestMethod, NSURL* requestURL, NSDictionary* requestHeaders, NSString* urlPath, NSDictionary* urlQuery) { + [self addHandlerWithMatchBlock:^GCDWebServerRequest*(NSString* requestMethod, NSURL* requestURL, NSDictionary* requestHeaders, NSString* urlPath, NSDictionary* urlQuery) { if (![requestMethod isEqualToString:method]) { return nil; } @@ -888,7 +888,7 @@ static inline NSString* _EncodeBase64(NSString* string) { - (void)addHandlerForMethod:(NSString*)method path:(NSString*)path requestClass:(Class)aClass asyncProcessBlock:(GCDWebServerAsyncProcessBlock)block { if ([path hasPrefix:@"/"] && [aClass isSubclassOfClass:[GCDWebServerRequest class]]) { - [self addHandlerWithMatchBlock:^GCDWebServerRequest*(NSString* requestMethod, NSURL* requestURL, NSDictionary* requestHeaders, NSString* urlPath, NSDictionary* urlQuery) { + [self addHandlerWithMatchBlock:^GCDWebServerRequest*(NSString* requestMethod, NSURL* requestURL, NSDictionary* requestHeaders, NSString* urlPath, NSDictionary* urlQuery) { if (![requestMethod isEqualToString:method]) { return nil; } @@ -915,7 +915,7 @@ static inline NSString* _EncodeBase64(NSString* string) { - (void)addHandlerForMethod:(NSString*)method pathRegex:(NSString*)regex requestClass:(Class)aClass asyncProcessBlock:(GCDWebServerAsyncProcessBlock)block { NSRegularExpression* expression = [NSRegularExpression regularExpressionWithPattern:regex options:NSRegularExpressionCaseInsensitive error:NULL]; if (expression && [aClass isSubclassOfClass:[GCDWebServerRequest class]]) { - [self addHandlerWithMatchBlock:^GCDWebServerRequest*(NSString* requestMethod, NSURL* requestURL, NSDictionary* requestHeaders, NSString* urlPath, NSDictionary* urlQuery) { + [self addHandlerWithMatchBlock:^GCDWebServerRequest*(NSString* requestMethod, NSURL* requestURL, NSDictionary* requestHeaders, NSString* urlPath, NSDictionary* urlQuery) { if (![requestMethod isEqualToString:method]) { return nil; } @@ -1013,7 +1013,7 @@ static inline NSString* _EncodeBase64(NSString* string) { - (void)addGETHandlerForBasePath:(NSString*)basePath directoryPath:(NSString*)directoryPath indexFilename:(NSString*)indexFilename cacheAge:(NSUInteger)cacheAge allowRangeRequests:(BOOL)allowRangeRequests { if ([basePath hasPrefix:@"/"] && [basePath hasSuffix:@"/"]) { GCDWebServer* __unsafe_unretained server = self; - [self addHandlerWithMatchBlock:^GCDWebServerRequest*(NSString* requestMethod, NSURL* requestURL, NSDictionary* requestHeaders, NSString* urlPath, NSDictionary* urlQuery) { + [self addHandlerWithMatchBlock:^GCDWebServerRequest*(NSString* requestMethod, NSURL* requestURL, NSDictionary* requestHeaders, NSString* urlPath, NSDictionary* urlQuery) { if (![requestMethod isEqualToString:@"GET"]) { return nil; } @@ -1168,7 +1168,7 @@ static void _LogResult(NSString* format, ...) { fprintf(stdout, "%s\n", [message UTF8String]); } -- (NSInteger)runTestsWithOptions:(NSDictionary*)options inDirectory:(NSString*)path { +- (NSInteger)runTestsWithOptions:(NSDictionary*)options inDirectory:(NSString*)path { GWS_DCHECK([NSThread isMainThread]); NSArray* ignoredHeaders = @[ @"Date", @"Etag" ]; // Dates are always different by definition and ETags depend on file system node IDs NSInteger result = -1; diff --git a/GCDWebServer/Core/GCDWebServerConnection.h b/GCDWebServer/Core/GCDWebServerConnection.h index 420d12a..8b40652 100644 --- a/GCDWebServer/Core/GCDWebServerConnection.h +++ b/GCDWebServer/Core/GCDWebServerConnection.h @@ -130,7 +130,7 @@ NS_ASSUME_NONNULL_BEGIN * * The default implementation returns the original URL. */ -- (NSURL*)rewriteRequestURL:(NSURL*)url withMethod:(NSString*)method headers:(NSDictionary*)headers; +- (NSURL*)rewriteRequestURL:(NSURL*)url withMethod:(NSString*)method headers:(NSDictionary*)headers; /** * Assuming a valid HTTP request was received, this method is called before diff --git a/GCDWebServer/Core/GCDWebServerConnection.m b/GCDWebServer/Core/GCDWebServerConnection.m index d491fdb..ea5df23 100644 --- a/GCDWebServer/Core/GCDWebServerConnection.m +++ b/GCDWebServer/Core/GCDWebServerConnection.m @@ -698,7 +698,7 @@ static inline NSUInteger _ScanHexNumber(const void* bytes, NSUInteger size) { #endif } -- (NSURL*)rewriteRequestURL:(NSURL*)url withMethod:(NSString*)method headers:(NSDictionary*)headers { +- (NSURL*)rewriteRequestURL:(NSURL*)url withMethod:(NSString*)method headers:(NSDictionary*)headers { return url; } diff --git a/GCDWebServer/Core/GCDWebServerFunctions.h b/GCDWebServer/Core/GCDWebServerFunctions.h index 4235ecc..6bf978f 100644 --- a/GCDWebServer/Core/GCDWebServerFunctions.h +++ b/GCDWebServer/Core/GCDWebServerFunctions.h @@ -41,7 +41,7 @@ extern "C" { * types. Keys of the dictionary must be lowercased file extensions without * the period, and the values must be the corresponding MIME types. */ -NSString* GCDWebServerGetMimeTypeForExtension(NSString* extension, NSDictionary* _Nullable overrides); +NSString* GCDWebServerGetMimeTypeForExtension(NSString* extension, NSDictionary* _Nullable overrides); /** * Add percent-escapes to a string so it can be used in a URL. @@ -60,7 +60,7 @@ NSString* _Nullable GCDWebServerUnescapeURLString(NSString* string); * "application/x-www-form-urlencoded" form. * http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1 */ -NSDictionary* GCDWebServerParseURLEncodedForm(NSString* form); +NSDictionary* GCDWebServerParseURLEncodedForm(NSString* form); /** * On OS X, returns the IPv4 or IPv6 address as a string of the primary diff --git a/GCDWebServer/Core/GCDWebServerFunctions.m b/GCDWebServer/Core/GCDWebServerFunctions.m index 05db683..df96a0d 100644 --- a/GCDWebServer/Core/GCDWebServerFunctions.m +++ b/GCDWebServer/Core/GCDWebServerFunctions.m @@ -166,7 +166,7 @@ NSString* GCDWebServerDescribeData(NSData* data, NSString* type) { return [NSString stringWithFormat:@"<%lu bytes>", (unsigned long)data.length]; } -NSString* GCDWebServerGetMimeTypeForExtension(NSString* extension, NSDictionary* overrides) { +NSString* GCDWebServerGetMimeTypeForExtension(NSString* extension, NSDictionary* overrides) { NSDictionary* builtInOverrides = @{@"css" : @"text/css"}; NSString* mimeType = nil; extension = [extension lowercaseString]; @@ -200,7 +200,7 @@ NSString* GCDWebServerUnescapeURLString(NSString* string) { #pragma clang diagnostic pop } -NSDictionary* GCDWebServerParseURLEncodedForm(NSString* form) { +NSDictionary* GCDWebServerParseURLEncodedForm(NSString* form) { NSMutableDictionary* parameters = [NSMutableDictionary dictionary]; NSScanner* scanner = [[NSScanner alloc] initWithString:form]; [scanner setCharactersToBeSkipped:nil]; diff --git a/GCDWebServer/Core/GCDWebServerPrivate.h b/GCDWebServer/Core/GCDWebServerPrivate.h index d726ec2..d485304 100644 --- a/GCDWebServer/Core/GCDWebServerPrivate.h +++ b/GCDWebServer/Core/GCDWebServerPrivate.h @@ -185,11 +185,11 @@ extern NSString* GCDWebServerStringFromSockAddr(const struct sockaddr* addr, BOO @end @interface GCDWebServer () -@property(nonatomic, readonly) NSMutableArray* handlers; +@property(nonatomic, readonly) NSMutableArray* handlers; @property(nonatomic, readonly, nullable) NSString* serverName; @property(nonatomic, readonly, nullable) NSString* authenticationRealm; -@property(nonatomic, readonly, nullable) NSMutableDictionary* authenticationBasicAccounts; -@property(nonatomic, readonly, nullable) NSMutableDictionary* authenticationDigestAccounts; +@property(nonatomic, readonly, nullable) NSMutableDictionary* authenticationBasicAccounts; +@property(nonatomic, readonly, nullable) NSMutableDictionary* authenticationDigestAccounts; @property(nonatomic, readonly) BOOL shouldAutomaticallyMapHEADToGET; @property(nonatomic, readonly) dispatch_queue_priority_t dispatchQueuePriority; - (void)willStartConnection:(GCDWebServerConnection*)connection; @@ -213,7 +213,7 @@ extern NSString* GCDWebServerStringFromSockAddr(const struct sockaddr* addr, BOO @end @interface GCDWebServerResponse () -@property(nonatomic, readonly) NSDictionary* additionalHeaders; +@property(nonatomic, readonly) NSDictionary* additionalHeaders; @property(nonatomic, readonly) BOOL usesChunkedTransferEncoding; - (void)prepareForReading; - (BOOL)performOpen:(NSError**)error; diff --git a/GCDWebServer/Core/GCDWebServerRequest.h b/GCDWebServer/Core/GCDWebServerRequest.h index 3fe9029..016262d 100644 --- a/GCDWebServer/Core/GCDWebServerRequest.h +++ b/GCDWebServer/Core/GCDWebServerRequest.h @@ -102,7 +102,7 @@ extern NSString* const GCDWebServerRequestAttribute_RegexCaptures; /** * Returns the HTTP headers for the request. */ -@property(nonatomic, readonly) NSDictionary* headers; +@property(nonatomic, readonly) NSDictionary* headers; /** * Returns the path component of the URL for the request. @@ -114,7 +114,7 @@ extern NSString* const GCDWebServerRequestAttribute_RegexCaptures; * * @warning This property will be nil if there is no query in the URL. */ -@property(nonatomic, readonly, nullable) NSDictionary* query; +@property(nonatomic, readonly, nullable) NSDictionary* query; /** * Returns the content type for the body of the request parsed from the @@ -186,7 +186,7 @@ extern NSString* const GCDWebServerRequestAttribute_RegexCaptures; /** * This method is the designated initializer for the class. */ -- (instancetype)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(nullable NSDictionary*)query; +- (instancetype)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(nullable NSDictionary*)query; /** * Convenience method that checks if the contentType property is defined. diff --git a/GCDWebServer/Core/GCDWebServerRequest.m b/GCDWebServer/Core/GCDWebServerRequest.m index 05988cd..0803d5d 100644 --- a/GCDWebServer/Core/GCDWebServerRequest.m +++ b/GCDWebServer/Core/GCDWebServerRequest.m @@ -136,12 +136,12 @@ NSString* const GCDWebServerRequestAttribute_RegexCaptures = @"GCDWebServerReque @implementation GCDWebServerRequest { BOOL _opened; - NSMutableArray* _decoders; + NSMutableArray* _decoders; id __unsafe_unretained _writer; - NSMutableDictionary* _attributes; + NSMutableDictionary* _attributes; } -- (instancetype)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(NSDictionary*)query { +- (instancetype)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(NSDictionary*)query { if ((self = [super init])) { _method = [method copy]; _URL = url; diff --git a/GCDWebServer/Core/GCDWebServerResponse.m b/GCDWebServer/Core/GCDWebServerResponse.m index 9153ff6..fbc23ce 100644 --- a/GCDWebServer/Core/GCDWebServerResponse.m +++ b/GCDWebServer/Core/GCDWebServerResponse.m @@ -150,7 +150,7 @@ @implementation GCDWebServerResponse { BOOL _opened; - NSMutableArray* _encoders; + NSMutableArray* _encoders; id __unsafe_unretained _reader; } diff --git a/GCDWebServer/Requests/GCDWebServerFileRequest.m b/GCDWebServer/Requests/GCDWebServerFileRequest.m index 8a47fcc..c8e2855 100644 --- a/GCDWebServer/Requests/GCDWebServerFileRequest.m +++ b/GCDWebServer/Requests/GCDWebServerFileRequest.m @@ -35,7 +35,7 @@ int _file; } -- (instancetype)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(NSDictionary*)query { +- (instancetype)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(NSDictionary*)query { if ((self = [super initWithMethod:method url:url headers:headers path:path query:query])) { _temporaryPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]]; } diff --git a/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.h b/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.h index 93ac179..abe73c8 100644 --- a/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.h +++ b/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.h @@ -107,13 +107,13 @@ NS_ASSUME_NONNULL_BEGIN * Returns the argument parts from the multipart encoded form as * name / GCDWebServerMultiPartArgument pairs. */ -@property(nonatomic, readonly) NSArray* arguments; +@property(nonatomic, readonly) NSArray* arguments; /** * Returns the files parts from the multipart encoded form as * name / GCDWebServerMultiPartFile pairs. */ -@property(nonatomic, readonly) NSArray* files; +@property(nonatomic, readonly) NSArray* files; /** * Returns the MIME type for multipart encoded forms diff --git a/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.m b/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.m index 1013262..c866717 100644 --- a/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.m +++ b/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.m @@ -106,8 +106,8 @@ static NSData* _dashNewlineData = nil; NSString* _defaultcontrolName; ParserState _state; NSMutableData* _data; - NSMutableArray* _arguments; - NSMutableArray* _files; + NSMutableArray* _arguments; + NSMutableArray* _files; NSString* _controlName; NSString* _fileName; @@ -132,7 +132,7 @@ static NSData* _dashNewlineData = nil; } } -- (instancetype)initWithBoundary:(NSString* _Nonnull)boundary defaultControlName:(NSString* _Nullable)name arguments:(NSMutableArray* _Nonnull)arguments files:(NSMutableArray* _Nonnull)files { +- (instancetype)initWithBoundary:(NSString* _Nonnull)boundary defaultControlName:(NSString* _Nullable)name arguments:(NSMutableArray* _Nonnull)arguments files:(NSMutableArray* _Nonnull)files { NSData* data = boundary.length ? [[NSString stringWithFormat:@"--%@", boundary] dataUsingEncoding:NSASCIIStringEncoding] : nil; if (data == nil) { GWS_DNOT_REACHED(); @@ -312,8 +312,8 @@ static NSData* _dashNewlineData = nil; @end @interface GCDWebServerMultiPartFormRequest () -@property(nonatomic) NSMutableArray* arguments; -@property(nonatomic) NSMutableArray* files; +@property(nonatomic) NSMutableArray* arguments; +@property(nonatomic) NSMutableArray* files; @end @implementation GCDWebServerMultiPartFormRequest { @@ -324,7 +324,7 @@ static NSData* _dashNewlineData = nil; return @"multipart/form-data"; } -- (instancetype)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(NSDictionary*)query { +- (instancetype)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(NSDictionary*)query { if ((self = [super initWithMethod:method url:url headers:headers path:path query:query])) { _arguments = [[NSMutableArray alloc] init]; _files = [[NSMutableArray alloc] init]; diff --git a/GCDWebServer/Requests/GCDWebServerURLEncodedFormRequest.h b/GCDWebServer/Requests/GCDWebServerURLEncodedFormRequest.h index fcf177e..eb02982 100644 --- a/GCDWebServer/Requests/GCDWebServerURLEncodedFormRequest.h +++ b/GCDWebServer/Requests/GCDWebServerURLEncodedFormRequest.h @@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN * The text encoding used to interpret the data is extracted from the * "Content-Type" header or defaults to UTF-8. */ -@property(nonatomic, readonly) NSDictionary* arguments; +@property(nonatomic, readonly) NSDictionary* arguments; /** * Returns the MIME type for URL encoded forms diff --git a/GCDWebServer/Responses/GCDWebServerDataResponse.h b/GCDWebServer/Responses/GCDWebServerDataResponse.h index 783f596..579a46a 100644 --- a/GCDWebServer/Responses/GCDWebServerDataResponse.h +++ b/GCDWebServer/Responses/GCDWebServerDataResponse.h @@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN * Creates a data response from an HTML template encoded using UTF-8. * See -initWithHTMLTemplate:variables: for details. */ -+ (nullable instancetype)responseWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables; ++ (nullable instancetype)responseWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables; /** * Creates a data response from a serialized JSON object and the default @@ -94,7 +94,7 @@ NS_ASSUME_NONNULL_BEGIN * All occurences of "%variable%" within the HTML template are replaced with * their corresponding values. */ -- (nullable instancetype)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables; +- (nullable instancetype)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables; /** * Initializes a data response from a serialized JSON object and the default diff --git a/GCDWebServer/Responses/GCDWebServerDataResponse.m b/GCDWebServer/Responses/GCDWebServerDataResponse.m index b496847..77c91eb 100644 --- a/GCDWebServer/Responses/GCDWebServerDataResponse.m +++ b/GCDWebServer/Responses/GCDWebServerDataResponse.m @@ -112,7 +112,7 @@ return [self initWithData:data contentType:@"text/html; charset=utf-8"]; } -- (instancetype)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables { +- (instancetype)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables { NSMutableString* html = [[NSMutableString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:NULL]; [variables enumerateKeysAndObjectsUsingBlock:^(NSString* key, NSString* value, BOOL* stop) { [html replaceOccurrencesOfString:[NSString stringWithFormat:@"%%%@%%", key] withString:value options:0 range:NSMakeRange(0, html.length)]; diff --git a/GCDWebServer/Responses/GCDWebServerFileResponse.h b/GCDWebServer/Responses/GCDWebServerFileResponse.h index 9403835..1f66ec6 100644 --- a/GCDWebServer/Responses/GCDWebServerFileResponse.h +++ b/GCDWebServer/Responses/GCDWebServerFileResponse.h @@ -101,7 +101,7 @@ NS_ASSUME_NONNULL_BEGIN * file extensions without the period, and the values must be the corresponding * MIME types. */ -- (nullable instancetype)initWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment mimeTypeOverrides:(nullable NSDictionary*)overrides; +- (nullable instancetype)initWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment mimeTypeOverrides:(nullable NSDictionary*)overrides; @end diff --git a/GCDWebServer/Responses/GCDWebServerFileResponse.m b/GCDWebServer/Responses/GCDWebServerFileResponse.m index bd07518..ea8713f 100644 --- a/GCDWebServer/Responses/GCDWebServerFileResponse.m +++ b/GCDWebServer/Responses/GCDWebServerFileResponse.m @@ -76,7 +76,7 @@ static inline NSDate* _NSDateFromTimeSpec(const struct timespec* t) { return [NSDate dateWithTimeIntervalSince1970:((NSTimeInterval)t->tv_sec + (NSTimeInterval)t->tv_nsec / 1000000000.0)]; } -- (instancetype)initWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment mimeTypeOverrides:(NSDictionary*)overrides { +- (instancetype)initWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment mimeTypeOverrides:(NSDictionary*)overrides { struct stat info; if (lstat([path fileSystemRepresentation], &info) || !(info.st_mode & S_IFREG)) { GWS_DNOT_REACHED(); diff --git a/GCDWebUploader/GCDWebUploader.h b/GCDWebUploader/GCDWebUploader.h index 2332ba1..9db1c71 100644 --- a/GCDWebUploader/GCDWebUploader.h +++ b/GCDWebUploader/GCDWebUploader.h @@ -93,7 +93,7 @@ NS_ASSUME_NONNULL_BEGIN * * The default value is nil i.e. all file extensions are allowed. */ -@property(nonatomic, copy) NSArray* allowedFileExtensions; +@property(nonatomic, copy) NSArray* allowedFileExtensions; /** * Sets if files and directories whose name start with a period are allowed to