Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
b006dc90
Commit
b006dc90
authored
Jun 16, 2013
by
Felix Paul Kühne
Browse files
patches: fix crash in http server
parent
d9cb37d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
patches/cocoahttpserver/0004-fix-crash-when-uploading-multiple-files.patch
0 → 100644
View file @
b006dc90
From 72b746f89eced49a5e17b53a6e792f3a987efabf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
Date: Sun, 16 Jun 2013 23:35:17 +0200
Subject: [PATCH 4/4] fix crash when uploading multiple files
---
Core/HTTPConnection.m | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/Core/HTTPConnection.m b/Core/HTTPConnection.m
index 2742415..95e283a 100644
--- a/Core/HTTPConnection.m
+++ b/Core/HTTPConnection.m
@@ -1215,20 +1215,20 @@
static NSMutableArray *recentNonces;
else
{
/* add the proper MIME type */
- NSString *mimeType;
- NSString *pathExtension = [[httpResponse filePath] pathExtension];
- if ([pathExtension isEqualToString:@"html"] || [pathExtension isEqualToString:@"htm"])
- mimeType = @"text/html";
- else if ([pathExtension isEqualToString:@"js"])
- mimeType = @"text/javascript";
- else if ([pathExtension isEqualToString:@"css"])
- mimeType = @"text/css";
- else if ([pathExtension isEqualToString:@"png"])
- mimeType = @"image/png";
- else if ([pathExtension isEqualToString:@"jpg"] || [pathExtension isEqualToString:@"jpeg"])
- mimeType = @"image/jpeg";
- else
- mimeType = @"text/plain";
+ NSString *mimeType = @"text/plain";
+ if ([httpResponse respondsToSelector:@selector(filePath)]) {
+ NSString *pathExtension = [[httpResponse filePath] pathExtension];
+ if ([pathExtension isEqualToString:@"html"] || [pathExtension isEqualToString:@"htm"])
+ mimeType = @"text/html";
+ else if ([pathExtension isEqualToString:@"js"])
+ mimeType = @"text/javascript";
+ else if ([pathExtension isEqualToString:@"css"])
+ mimeType = @"text/css";
+ else if ([pathExtension isEqualToString:@"png"])
+ mimeType = @"image/png";
+ else if ([pathExtension isEqualToString:@"jpg"] || [pathExtension isEqualToString:@"jpeg"])
+ mimeType = @"image/jpeg";
+ }
[response setHeaderField:@"Content-Type" value:mimeType];
// Write the header response
--
1.8.2.1 (Apple Git-45)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment