Properly handle casing of header values

This commit is contained in:
Pierre-Olivier Latour
2014-04-09 10:34:33 -07:00
parent f14dda522c
commit 811e45ab26
8 changed files with 57 additions and 39 deletions
+1 -1
View File
@@ -77,7 +77,7 @@
- (NSString*)text {
if (_text == nil) {
if ([self.contentType hasPrefix:@"text/"]) {
NSString* charset = GCDWebServerExtractHeaderParameter(self.contentType, @"charset");
NSString* charset = GCDWebServerExtractHeaderValueParameter(self.contentType, @"charset");
_text = [[NSString alloc] initWithData:self.data encoding:GCDWebServerStringEncodingFromCharset(charset)];
} else {
DNOT_REACHED();