mirror of
https://github.com/swisspol/GCDWebServer.git
synced 2026-02-11 00:00:07 +08:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2543279a6d | ||
|
|
95231b1a66 | ||
|
|
5f2877b85f | ||
|
|
47a51c3d42 | ||
|
|
3873dd1ad3 | ||
|
|
2ff10258e7 | ||
|
|
4360c4f7db | ||
|
|
8a6a139687 | ||
|
|
4eba86f348 | ||
|
|
ea973735c1 | ||
|
|
5707076e8d | ||
|
|
e1fb807a93 | ||
|
|
71575729e9 | ||
|
|
94e30f6442 | ||
|
|
062a0dcee4 |
@@ -14,6 +14,8 @@
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${BUNDLE_VERSION_STRING}</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${BUNDLE_VERSION_STRING}</string>
|
||||
</dict>
|
||||
|
||||
@@ -115,6 +115,11 @@ static inline BOOL _IsMacFinder(GCDWebServerRequest* request) {
|
||||
[self.delegate davServer:self didDownloadFileAtPath:absolutePath];
|
||||
});
|
||||
}
|
||||
|
||||
if ([request hasByteRange]) {
|
||||
return [GCDWebServerFileResponse responseWithFile:absolutePath byteRange:request.byteRange];
|
||||
}
|
||||
|
||||
return [GCDWebServerFileResponse responseWithFile:absolutePath];
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'GCDWebServer'
|
||||
s.version = '3.3'
|
||||
s.version = '3.3.1'
|
||||
s.author = { 'Pierre-Olivier Latour' => 'info@pol-online.net' }
|
||||
s.license = { :type => 'BSD', :file => 'LICENSE' }
|
||||
s.homepage = 'https://github.com/swisspol/GCDWebServer'
|
||||
@@ -33,21 +33,43 @@ Pod::Spec.new do |s|
|
||||
cs.osx.framework = 'SystemConfiguration'
|
||||
end
|
||||
|
||||
s.subspec 'WebDAV' do |cs|
|
||||
s.subspec "CocoaLumberjack" do |cs|
|
||||
cs.dependency 'GCDWebServer/Core'
|
||||
cs.source_files = 'GCDWebDAVServer/*.{h,m}'
|
||||
cs.requires_arc = true
|
||||
cs.ios.library = 'xml2'
|
||||
cs.tvos.library = 'xml2'
|
||||
cs.osx.library = 'xml2'
|
||||
cs.compiler_flags = '-I$(SDKROOT)/usr/include/libxml2'
|
||||
cs.dependency 'CocoaLumberjack', '~> 2'
|
||||
end
|
||||
|
||||
s.subspec 'WebDAV' do |cs|
|
||||
cs.default_subspec = 'Core'
|
||||
|
||||
cs.subspec "Core" do |ccs|
|
||||
ccs.dependency 'GCDWebServer/Core'
|
||||
ccs.source_files = 'GCDWebDAVServer/*.{h,m}'
|
||||
ccs.requires_arc = true
|
||||
ccs.ios.library = 'xml2'
|
||||
ccs.tvos.library = 'xml2'
|
||||
ccs.osx.library = 'xml2'
|
||||
ccs.compiler_flags = '-I$(SDKROOT)/usr/include/libxml2'
|
||||
end
|
||||
|
||||
cs.subspec "CocoaLumberjack" do |cscl|
|
||||
cscl.dependency 'GCDWebServer/WebDAV/Core'
|
||||
cscl.dependency 'GCDWebServer/CocoaLumberjack'
|
||||
end
|
||||
end
|
||||
|
||||
s.subspec 'WebUploader' do |cs|
|
||||
cs.dependency 'GCDWebServer/Core'
|
||||
cs.source_files = 'GCDWebUploader/*.{h,m}'
|
||||
cs.requires_arc = true
|
||||
cs.resource = "GCDWebUploader/GCDWebUploader.bundle"
|
||||
end
|
||||
|
||||
cs.default_subspec = 'Core'
|
||||
|
||||
cs.subspec "Core" do |ccs|
|
||||
ccs.dependency 'GCDWebServer/Core'
|
||||
ccs.source_files = 'GCDWebUploader/*.{h,m}'
|
||||
ccs.requires_arc = true
|
||||
ccs.resource = "GCDWebUploader/GCDWebUploader.bundle"
|
||||
end
|
||||
|
||||
cs.subspec "CocoaLumberjack" do |cscl|
|
||||
cscl.dependency 'GCDWebServer/WebUploader/Core'
|
||||
cscl.dependency 'GCDWebServer/CocoaLumberjack'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -854,7 +854,7 @@
|
||||
08FB7793FE84155DC02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0710;
|
||||
LastUpgradeCheck = 0720;
|
||||
TargetAttributes = {
|
||||
CEE28CD01AE004D800F4023C = {
|
||||
CreatedOnToolsVersion = 6.3;
|
||||
@@ -1208,7 +1208,7 @@
|
||||
1DEB928A08733DD80010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_VERSION_STRING = 3.3;
|
||||
BUNDLE_VERSION_STRING = 3.3.1;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
@@ -1245,7 +1245,7 @@
|
||||
1DEB928B08733DD80010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_VERSION_STRING = 3.3;
|
||||
BUNDLE_VERSION_STRING = 3.3.1;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = __GCDWEBSERVER_ENABLE_TESTING__;
|
||||
@@ -1520,6 +1520,7 @@
|
||||
E2DDD1911BE69404002CE867 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
E2DDD1D81BE698A8002CE867 /* Build configuration list for PBXNativeTarget "GCDWebServer (tvOS)" */ = {
|
||||
isa = XCConfigurationList;
|
||||
@@ -1528,6 +1529,7 @@
|
||||
E2DDD1DA1BE698A8002CE867 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
E2DDD20A1BE69EE5002CE867 /* Build configuration list for PBXNativeTarget "GCDWebServer (iOS)" */ = {
|
||||
isa = XCConfigurationList;
|
||||
@@ -1536,6 +1538,7 @@
|
||||
E2DDD20C1BE69EE5002CE867 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0710"
|
||||
LastUpgradeVersion = "0720"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0710"
|
||||
LastUpgradeVersion = "0720"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0710"
|
||||
LastUpgradeVersion = "0720"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
@@ -957,7 +957,12 @@ static inline NSString* _EncodeBase64(NSString* string) {
|
||||
for (NSTextCheckingResult* result in matches) {
|
||||
// Start at 1; index 0 is the whole string
|
||||
for (NSUInteger i = 1; i < result.numberOfRanges; i++) {
|
||||
[captures addObject:[urlPath substringWithRange:[result rangeAtIndex:i]]];
|
||||
NSRange range = [result rangeAtIndex:i];
|
||||
// range is {NSNotFound, 0} "if one of the capture groups did not participate in this particular match"
|
||||
// see discussion in -[NSRegularExpression firstMatchInString:options:range:]
|
||||
if (range.location != NSNotFound) {
|
||||
[captures addObject:[urlPath substringWithRange:range]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -267,8 +267,10 @@ NSString* GCDWebServerGetPrimaryIPAddress(BOOL useIPv6) {
|
||||
struct ifaddrs* list;
|
||||
if (getifaddrs(&list) >= 0) {
|
||||
for (struct ifaddrs* ifap = list; ifap; ifap = ifap->ifa_next) {
|
||||
#if TARGET_IPHONE_SIMULATOR
|
||||
if (strcmp(ifap->ifa_name, "en0") && strcmp(ifap->ifa_name, "en1")) // Assume en0 is Ethernet and en1 is WiFi since there is no way to use SystemConfiguration framework in iOS Simulator
|
||||
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_TV
|
||||
// Assume en0 is Ethernet and en1 is WiFi since there is no way to use SystemConfiguration framework in iOS Simulator
|
||||
// Assumption holds for Apple TV running tvOS
|
||||
if (strcmp(ifap->ifa_name, "en0") && strcmp(ifap->ifa_name, "en1"))
|
||||
#else
|
||||
if (strcmp(ifap->ifa_name, primaryInterface))
|
||||
#endif
|
||||
|
||||
@@ -44,6 +44,8 @@ Getting Started
|
||||
|
||||
Download or check out the [latest release](https://github.com/swisspol/GCDWebServer/releases) of GCDWebServer then add the entire "GCDWebServer" subfolder to your Xcode project. If you intend to use one of the extensions like GCDWebDAVServer or GCDWebUploader, add these subfolders as well.
|
||||
|
||||
If you add the files directly then (1) link to `libz` (via Target > Build Phases > Link Binary With Libraries) and (2) add `$(SDKROOT)/usr/include/libxml2` to your header search paths (via Target > Build Settings > HEADER_SEARCH_PATHS).
|
||||
|
||||
Alternatively, you can install GCDWebServer using [CocoaPods](http://cocoapods.org/) by simply adding this line to your Podfile:
|
||||
```
|
||||
pod "GCDWebServer", "~> 3.0"
|
||||
|
||||
Binary file not shown.
BIN
Tests/WebDAV-Finder/059-206.response
Executable file
BIN
Tests/WebDAV-Finder/059-206.response
Executable file
Binary file not shown.
Binary file not shown.
BIN
Tests/WebDAV-Finder/062-206.response
Normal file
BIN
Tests/WebDAV-Finder/062-206.response
Normal file
Binary file not shown.
Reference in New Issue
Block a user