Skip to content

Commit e26c9b7

Browse files
committed
Updated to "instancetype" type
1 parent 3401206 commit e26c9b7

20 files changed

+84
-83
lines changed

CGDWebServer/GCDWebServer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ NSString* GCDWebServerGetPrimaryIPv4Address(); // Returns IPv4 address of prima
5151
@property(nonatomic, readonly, getter=isRunning) BOOL running;
5252
@property(nonatomic, readonly) NSUInteger port;
5353
@property(nonatomic, readonly) NSString* bonjourName; // Only non-nil if Bonjour registration is active
54+
- (instancetype)init;
5455
- (void)addHandlerWithMatchBlock:(GCDWebServerMatchBlock)matchBlock processBlock:(GCDWebServerProcessBlock)processBlock;
5556
- (void)removeAllHandlers;
5657

CGDWebServer/GCDWebServer.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ + (void)initialize {
261261
[GCDWebServerConnection class]; // Initialize class immediately to make sure it happens on the main thread
262262
}
263263

264-
- (id)init {
264+
- (instancetype)init {
265265
if ((self = [super init])) {
266266
_handlers = [[NSMutableArray alloc] init];
267267
}

CGDWebServer/GCDWebServerDataResponse.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@
2828
#import "GCDWebServerResponse.h"
2929

3030
@interface GCDWebServerDataResponse : GCDWebServerResponse
31-
+ (GCDWebServerDataResponse*)responseWithData:(NSData*)data contentType:(NSString*)type;
32-
- (id)initWithData:(NSData*)data contentType:(NSString*)type;
31+
+ (instancetype)responseWithData:(NSData*)data contentType:(NSString*)type;
32+
- (instancetype)initWithData:(NSData*)data contentType:(NSString*)type;
3333
@end
3434

3535
@interface GCDWebServerDataResponse (Extensions)
36-
+ (GCDWebServerDataResponse*)responseWithText:(NSString*)text;
37-
+ (GCDWebServerDataResponse*)responseWithHTML:(NSString*)html;
38-
+ (GCDWebServerDataResponse*)responseWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables;
39-
+ (GCDWebServerDataResponse*)responseWithJSONObject:(id)object;
40-
+ (GCDWebServerDataResponse*)responseWithJSONObject:(id)object contentType:(NSString*)type;
41-
- (id)initWithText:(NSString*)text; // Encodes using UTF-8
42-
- (id)initWithHTML:(NSString*)html; // Encodes using UTF-8
43-
- (id)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables; // Simple template system that replaces all occurences of "%variable%" with corresponding value (encodes using UTF-8)
44-
- (id)initWithJSONObject:(id)object;
45-
- (id)initWithJSONObject:(id)object contentType:(NSString*)type;
36+
+ (instancetype)responseWithText:(NSString*)text;
37+
+ (instancetype)responseWithHTML:(NSString*)html;
38+
+ (instancetype)responseWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables;
39+
+ (instancetype)responseWithJSONObject:(id)object;
40+
+ (instancetype)responseWithJSONObject:(id)object contentType:(NSString*)type;
41+
- (instancetype)initWithText:(NSString*)text; // Encodes using UTF-8
42+
- (instancetype)initWithHTML:(NSString*)html; // Encodes using UTF-8
43+
- (instancetype)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables; // Simple template system that replaces all occurences of "%variable%" with corresponding value (encodes using UTF-8)
44+
- (instancetype)initWithJSONObject:(id)object;
45+
- (instancetype)initWithJSONObject:(id)object contentType:(NSString*)type;
4646
@end

CGDWebServer/GCDWebServerDataResponse.m

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ @interface GCDWebServerDataResponse () {
3636

3737
@implementation GCDWebServerDataResponse
3838

39-
+ (GCDWebServerDataResponse*)responseWithData:(NSData*)data contentType:(NSString*)type {
39+
+ (instancetype)responseWithData:(NSData*)data contentType:(NSString*)type {
4040
return ARC_AUTORELEASE([[[self class] alloc] initWithData:data contentType:type]);
4141
}
4242

43-
- (id)initWithData:(NSData*)data contentType:(NSString*)type {
43+
- (instancetype)initWithData:(NSData*)data contentType:(NSString*)type {
4444
if (data == nil) {
4545
DNOT_REACHED();
4646
ARC_RELEASE(self);
@@ -77,27 +77,27 @@ - (NSData*)readData:(NSError**)error {
7777

7878
@implementation GCDWebServerDataResponse (Extensions)
7979

80-
+ (GCDWebServerDataResponse*)responseWithText:(NSString*)text {
80+
+ (instancetype)responseWithText:(NSString*)text {
8181
return ARC_AUTORELEASE([[self alloc] initWithText:text]);
8282
}
8383

84-
+ (GCDWebServerDataResponse*)responseWithHTML:(NSString*)html {
84+
+ (instancetype)responseWithHTML:(NSString*)html {
8585
return ARC_AUTORELEASE([[self alloc] initWithHTML:html]);
8686
}
8787

88-
+ (GCDWebServerDataResponse*)responseWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables {
88+
+ (instancetype)responseWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables {
8989
return ARC_AUTORELEASE([[self alloc] initWithHTMLTemplate:path variables:variables]);
9090
}
9191

92-
+ (GCDWebServerDataResponse*)responseWithJSONObject:(id)object {
92+
+ (instancetype)responseWithJSONObject:(id)object {
9393
return ARC_AUTORELEASE([[self alloc] initWithJSONObject:object]);
9494
}
9595

96-
+ (GCDWebServerDataResponse*)responseWithJSONObject:(id)object contentType:(NSString*)type {
96+
+ (instancetype)responseWithJSONObject:(id)object contentType:(NSString*)type {
9797
return ARC_AUTORELEASE([[self alloc] initWithJSONObject:object contentType:type]);
9898
}
9999

100-
- (id)initWithText:(NSString*)text {
100+
- (instancetype)initWithText:(NSString*)text {
101101
NSData* data = [text dataUsingEncoding:NSUTF8StringEncoding];
102102
if (data == nil) {
103103
DNOT_REACHED();
@@ -107,7 +107,7 @@ - (id)initWithText:(NSString*)text {
107107
return [self initWithData:data contentType:@"text/plain; charset=utf-8"];
108108
}
109109

110-
- (id)initWithHTML:(NSString*)html {
110+
- (instancetype)initWithHTML:(NSString*)html {
111111
NSData* data = [html dataUsingEncoding:NSUTF8StringEncoding];
112112
if (data == nil) {
113113
DNOT_REACHED();
@@ -117,7 +117,7 @@ - (id)initWithHTML:(NSString*)html {
117117
return [self initWithData:data contentType:@"text/html; charset=utf-8"];
118118
}
119119

120-
- (id)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables {
120+
- (instancetype)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables {
121121
NSMutableString* html = [[NSMutableString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:NULL];
122122
[variables enumerateKeysAndObjectsUsingBlock:^(NSString* key, NSString* value, BOOL* stop) {
123123
[html replaceOccurrencesOfString:[NSString stringWithFormat:@"%%%@%%", key] withString:value options:0 range:NSMakeRange(0, html.length)];
@@ -127,11 +127,11 @@ - (id)initWithHTMLTemplate:(NSString*)path variables:(NSDictionary*)variables {
127127
return response;
128128
}
129129

130-
- (id)initWithJSONObject:(id)object {
130+
- (instancetype)initWithJSONObject:(id)object {
131131
return [self initWithJSONObject:object contentType:@"application/json"];
132132
}
133133

134-
- (id)initWithJSONObject:(id)object contentType:(NSString*)type {
134+
- (instancetype)initWithJSONObject:(id)object contentType:(NSString*)type {
135135
NSData* data = [NSJSONSerialization dataWithJSONObject:object options:0 error:NULL];
136136
if (data == nil) {
137137
ARC_RELEASE(self);

CGDWebServer/GCDWebServerErrorResponse.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030

3131
// Returns responses with an HTML body containing the error message
3232
@interface GCDWebServerErrorResponse : GCDWebServerDataResponse
33-
+ (GCDWebServerErrorResponse*)responseWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode message:(NSString*)format, ... NS_FORMAT_FUNCTION(2,3);
34-
+ (GCDWebServerErrorResponse*)responseWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode message:(NSString*)format, ... NS_FORMAT_FUNCTION(2,3);
35-
+ (GCDWebServerErrorResponse*)responseWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... NS_FORMAT_FUNCTION(3,4);
36-
+ (GCDWebServerErrorResponse*)responseWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... NS_FORMAT_FUNCTION(3,4);
37-
- (id)initWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode message:(NSString*)format, ... NS_FORMAT_FUNCTION(2,3);
38-
- (id)initWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode message:(NSString*)format, ... NS_FORMAT_FUNCTION(2,3);
39-
- (id)initWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... NS_FORMAT_FUNCTION(3,4);
40-
- (id)initWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... NS_FORMAT_FUNCTION(3,4);
33+
+ (instancetype)responseWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode message:(NSString*)format, ... NS_FORMAT_FUNCTION(2,3);
34+
+ (instancetype)responseWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode message:(NSString*)format, ... NS_FORMAT_FUNCTION(2,3);
35+
+ (instancetype)responseWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... NS_FORMAT_FUNCTION(3,4);
36+
+ (instancetype)responseWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... NS_FORMAT_FUNCTION(3,4);
37+
- (instancetype)initWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode message:(NSString*)format, ... NS_FORMAT_FUNCTION(2,3);
38+
- (instancetype)initWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode message:(NSString*)format, ... NS_FORMAT_FUNCTION(2,3);
39+
- (instancetype)initWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... NS_FORMAT_FUNCTION(3,4);
40+
- (instancetype)initWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... NS_FORMAT_FUNCTION(3,4);
4141
@end

CGDWebServer/GCDWebServerErrorResponse.m

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
#import "GCDWebServerPrivate.h"
2929

3030
@interface GCDWebServerErrorResponse ()
31-
- (id)initWithStatusCode:(NSInteger)statusCode underlyingError:(NSError*)underlyingError messageFormat:(NSString*)format arguments:(va_list)arguments;
31+
- (instancetype)initWithStatusCode:(NSInteger)statusCode underlyingError:(NSError*)underlyingError messageFormat:(NSString*)format arguments:(va_list)arguments;
3232
@end
3333

3434
@implementation GCDWebServerErrorResponse
3535

36-
+ (GCDWebServerErrorResponse*)responseWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode message:(NSString*)format, ... {
36+
+ (instancetype)responseWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode message:(NSString*)format, ... {
3737
DCHECK(((NSInteger)errorCode >= 400) && ((NSInteger)errorCode < 500));
3838
va_list arguments;
3939
va_start(arguments, format);
@@ -42,7 +42,7 @@ + (GCDWebServerErrorResponse*)responseWithClientError:(GCDWebServerClientErrorHT
4242
return response;
4343
}
4444

45-
+ (GCDWebServerErrorResponse*)responseWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode message:(NSString*)format, ... {
45+
+ (instancetype)responseWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode message:(NSString*)format, ... {
4646
DCHECK(((NSInteger)errorCode >= 500) && ((NSInteger)errorCode < 600));
4747
va_list arguments;
4848
va_start(arguments, format);
@@ -51,7 +51,7 @@ + (GCDWebServerErrorResponse*)responseWithServerError:(GCDWebServerServerErrorHT
5151
return response;
5252
}
5353

54-
+ (GCDWebServerErrorResponse*)responseWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... {
54+
+ (instancetype)responseWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... {
5555
DCHECK(((NSInteger)errorCode >= 400) && ((NSInteger)errorCode < 500));
5656
va_list arguments;
5757
va_start(arguments, format);
@@ -60,7 +60,7 @@ + (GCDWebServerErrorResponse*)responseWithClientError:(GCDWebServerClientErrorHT
6060
return response;
6161
}
6262

63-
+ (GCDWebServerErrorResponse*)responseWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... {
63+
+ (instancetype)responseWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... {
6464
DCHECK(((NSInteger)errorCode >= 500) && ((NSInteger)errorCode < 600));
6565
va_list arguments;
6666
va_start(arguments, format);
@@ -73,7 +73,7 @@ + (GCDWebServerErrorResponse*)responseWithServerError:(GCDWebServerServerErrorHT
7373
return [string stringByReplacingOccurrencesOfString:@"\"" withString:@"&quot;"];
7474
}
7575

76-
- (id)initWithStatusCode:(NSInteger)statusCode underlyingError:(NSError*)underlyingError messageFormat:(NSString*)format arguments:(va_list)arguments {
76+
- (instancetype)initWithStatusCode:(NSInteger)statusCode underlyingError:(NSError*)underlyingError messageFormat:(NSString*)format arguments:(va_list)arguments {
7777
NSString* message = [[NSString alloc] initWithFormat:format arguments:arguments];
7878
NSString* title = [NSString stringWithFormat:@"HTTP Error %i", (int)statusCode];
7979
NSString* error = underlyingError ? [NSString stringWithFormat:@"[%@] %@ (%li)", underlyingError.domain, _EscapeHTMLString(underlyingError.localizedDescription), (long)underlyingError.code] : @"";
@@ -86,7 +86,7 @@ - (id)initWithStatusCode:(NSInteger)statusCode underlyingError:(NSError*)underly
8686
return self;
8787
}
8888

89-
- (id)initWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode message:(NSString*)format, ... {
89+
- (instancetype)initWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode message:(NSString*)format, ... {
9090
DCHECK(((NSInteger)errorCode >= 400) && ((NSInteger)errorCode < 500));
9191
va_list arguments;
9292
va_start(arguments, format);
@@ -95,7 +95,7 @@ - (id)initWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode messa
9595
return self;
9696
}
9797

98-
- (id)initWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode message:(NSString*)format, ... {
98+
- (instancetype)initWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode message:(NSString*)format, ... {
9999
DCHECK(((NSInteger)errorCode >= 500) && ((NSInteger)errorCode < 600));
100100
va_list arguments;
101101
va_start(arguments, format);
@@ -104,7 +104,7 @@ - (id)initWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode messa
104104
return self;
105105
}
106106

107-
- (id)initWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... {
107+
- (instancetype)initWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... {
108108
DCHECK(((NSInteger)errorCode >= 400) && ((NSInteger)errorCode < 500));
109109
va_list arguments;
110110
va_start(arguments, format);
@@ -113,7 +113,7 @@ - (id)initWithClientError:(GCDWebServerClientErrorHTTPStatusCode)errorCode under
113113
return self;
114114
}
115115

116-
- (id)initWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... {
116+
- (instancetype)initWithServerError:(GCDWebServerServerErrorHTTPStatusCode)errorCode underlyingError:(NSError*)underlyingError message:(NSString*)format, ... {
117117
DCHECK(((NSInteger)errorCode >= 500) && ((NSInteger)errorCode < 600));
118118
va_list arguments;
119119
va_start(arguments, format);

CGDWebServer/GCDWebServerFileRequest.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ @implementation GCDWebServerFileRequest
4242

4343
@synthesize filePath=_filePath;
4444

45-
- (id)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(NSDictionary*)query {
45+
- (instancetype)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(NSDictionary*)query {
4646
if ((self = [super initWithMethod:method url:url headers:headers path:path query:query])) {
4747
_filePath = ARC_RETAIN([NSTemporaryDirectory() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]]);
4848
}

CGDWebServer/GCDWebServerFileResponse.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
#import "GCDWebServerResponse.h"
2929

3030
@interface GCDWebServerFileResponse : GCDWebServerResponse
31-
+ (GCDWebServerFileResponse*)responseWithFile:(NSString*)path;
32-
+ (GCDWebServerFileResponse*)responseWithFile:(NSString*)path isAttachment:(BOOL)attachment;
33-
+ (GCDWebServerFileResponse*)responseWithFile:(NSString*)path byteRange:(NSRange)range;
34-
+ (GCDWebServerFileResponse*)responseWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment;
35-
- (id)initWithFile:(NSString*)path;
36-
- (id)initWithFile:(NSString*)path isAttachment:(BOOL)attachment;
37-
- (id)initWithFile:(NSString*)path byteRange:(NSRange)range; // Pass [NSNotFound, 0] to disable byte range entirely, [offset, length] to enable byte range from beginning of file or [NSNotFound, -bytes] from end of file
38-
- (id)initWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment;
31+
+ (instancetype)responseWithFile:(NSString*)path;
32+
+ (instancetype)responseWithFile:(NSString*)path isAttachment:(BOOL)attachment;
33+
+ (instancetype)responseWithFile:(NSString*)path byteRange:(NSRange)range;
34+
+ (instancetype)responseWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment;
35+
- (instancetype)initWithFile:(NSString*)path;
36+
- (instancetype)initWithFile:(NSString*)path isAttachment:(BOOL)attachment;
37+
- (instancetype)initWithFile:(NSString*)path byteRange:(NSRange)range; // Pass [NSNotFound, 0] to disable byte range entirely, [offset, length] to enable byte range from beginning of file or [NSNotFound, -bytes] from end of file
38+
- (instancetype)initWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment;
3939
@end

CGDWebServer/GCDWebServerFileResponse.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,35 +46,35 @@ @interface GCDWebServerFileResponse () {
4646

4747
@implementation GCDWebServerFileResponse
4848

49-
+ (GCDWebServerFileResponse*)responseWithFile:(NSString*)path {
49+
+ (instancetype)responseWithFile:(NSString*)path {
5050
return ARC_AUTORELEASE([[[self class] alloc] initWithFile:path]);
5151
}
5252

53-
+ (GCDWebServerFileResponse*)responseWithFile:(NSString*)path isAttachment:(BOOL)attachment {
53+
+ (instancetype)responseWithFile:(NSString*)path isAttachment:(BOOL)attachment {
5454
return ARC_AUTORELEASE([[[self class] alloc] initWithFile:path isAttachment:attachment]);
5555
}
5656

57-
+ (GCDWebServerFileResponse*)responseWithFile:(NSString*)path byteRange:(NSRange)range {
57+
+ (instancetype)responseWithFile:(NSString*)path byteRange:(NSRange)range {
5858
return ARC_AUTORELEASE([[[self class] alloc] initWithFile:path byteRange:range]);
5959
}
6060

61-
+ (GCDWebServerFileResponse*)responseWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment {
61+
+ (instancetype)responseWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment {
6262
return ARC_AUTORELEASE([[[self class] alloc] initWithFile:path byteRange:range isAttachment:attachment]);
6363
}
6464

65-
- (id)initWithFile:(NSString*)path {
65+
- (instancetype)initWithFile:(NSString*)path {
6666
return [self initWithFile:path byteRange:NSMakeRange(NSNotFound, 0) isAttachment:NO];
6767
}
6868

69-
- (id)initWithFile:(NSString*)path isAttachment:(BOOL)attachment {
69+
- (instancetype)initWithFile:(NSString*)path isAttachment:(BOOL)attachment {
7070
return [self initWithFile:path byteRange:NSMakeRange(NSNotFound, 0) isAttachment:attachment];
7171
}
7272

73-
- (id)initWithFile:(NSString*)path byteRange:(NSRange)range {
73+
- (instancetype)initWithFile:(NSString*)path byteRange:(NSRange)range {
7474
return [self initWithFile:path byteRange:range isAttachment:NO];
7575
}
7676

77-
- (id)initWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment {
77+
- (instancetype)initWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment {
7878
struct stat info;
7979
if (lstat([path fileSystemRepresentation], &info) || !(info.st_mode & S_IFREG)) {
8080
DNOT_REACHED();

CGDWebServer/GCDWebServerMultiPartFormRequest.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ + (NSString*)mimeType {
185185
return @"multipart/form-data";
186186
}
187187

188-
- (id)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(NSDictionary*)query {
188+
- (instancetype)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(NSDictionary*)query {
189189
if ((self = [super initWithMethod:method url:url headers:headers path:path query:query])) {
190190
NSString* boundary = GCDWebServerExtractHeaderParameter(self.contentType, @"boundary");
191191
if (boundary) {

0 commit comments

Comments
 (0)