diff --git a/GCDWebServer/Core/GCDWebServerRequest.h b/GCDWebServer/Core/GCDWebServerRequest.h index 2fc1260..8e039a0 100644 --- a/GCDWebServer/Core/GCDWebServerRequest.h +++ b/GCDWebServer/Core/GCDWebServerRequest.h @@ -43,7 +43,7 @@ @property(nonatomic, readonly) NSUInteger contentLength; // Automatically parsed from headers (NSNotFound if request has no "Content-Length" header) @property(nonatomic, readonly) NSDate* ifModifiedSince; // Automatically parsed from headers (nil if request has no "If-Modified-Since" header or it is malformatted) @property(nonatomic, readonly) NSString* ifNoneMatch; // Automatically parsed from headers (nil if request has no "If-None-Match" header) -@property(nonatomic, readonly) NSRange byteRange; // Automatically parsed from headers ([NSNotFound, 0] if request has no "Range" header, [offset, length] for byte range from beginning or [NSNotFound, -bytes] from end) +@property(nonatomic, readonly) NSRange byteRange; // Automatically parsed from headers ([NSNotFound, 0] if request has no "Range" header, [offset, length] for byte range from beginning or [NSNotFound, -length] from end) @property(nonatomic, readonly) BOOL acceptsGzipContentEncoding; // Automatically parsed from headers - (instancetype)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(NSDictionary*)query; - (BOOL)hasBody; // Convenience method that checks if "contentType" is not nil diff --git a/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.h b/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.h index b09a169..3e94214 100644 --- a/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.h +++ b/GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.h @@ -28,7 +28,7 @@ #import "GCDWebServerRequest.h" @interface GCDWebServerMultiPart : NSObject -@property(nonatomic, readonly) NSString* contentType; // Defaults to "text/plain" per specifications if undefined +@property(nonatomic, readonly) NSString* contentType; // Defaults to "text/plain" per specification if undefined @property(nonatomic, readonly) NSString* mimeType; @end diff --git a/GCDWebServer/Responses/GCDWebServerFileResponse.h b/GCDWebServer/Responses/GCDWebServerFileResponse.h index 2ed57bb..9d0efef 100644 --- a/GCDWebServer/Responses/GCDWebServerFileResponse.h +++ b/GCDWebServer/Responses/GCDWebServerFileResponse.h @@ -33,7 +33,7 @@ + (instancetype)responseWithFile:(NSString*)path byteRange:(NSRange)range; + (instancetype)responseWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment; - (instancetype)initWithFile:(NSString*)path; -- (instancetype)initWithFile:(NSString*)path isAttachment:(BOOL)attachment; -- (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 +- (instancetype)initWithFile:(NSString*)path isAttachment:(BOOL)attachment; // If in attachment mode, "Content-Disposition" header will be set accordingly +- (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, -length] from end of file - (instancetype)initWithFile:(NSString*)path byteRange:(NSRange)range isAttachment:(BOOL)attachment; @end diff --git a/GCDWebServer/Responses/GCDWebServerStreamingResponse.h b/GCDWebServer/Responses/GCDWebServerStreamingResponse.h index 313eec3..52e7a28 100644 --- a/GCDWebServer/Responses/GCDWebServerStreamingResponse.h +++ b/GCDWebServer/Responses/GCDWebServerStreamingResponse.h @@ -29,7 +29,7 @@ typedef NSData* (^GCDWebServerStreamBlock)(NSError** error); -@interface GCDWebServerStreamingResponse : GCDWebServerResponse // Automatically enables chunked transfer encoding +@interface GCDWebServerStreamingResponse : GCDWebServerResponse + (instancetype)responseWithContentType:(NSString*)type streamBlock:(GCDWebServerStreamBlock)block; -- (instancetype)initWithContentType:(NSString*)type streamBlock:(GCDWebServerStreamBlock)block; // Block must return empty NSData when done or nil on error +- (instancetype)initWithContentType:(NSString*)type streamBlock:(GCDWebServerStreamBlock)block; // Block must return empty NSData when done or nil on error and set the "error" argument accordingly @end