Skip to content

Commit d3e94e3

Browse files
committed
Update GCDWebServer, update example to RN 57
1 parent f084947 commit d3e94e3

35 files changed

+5708
-11245
lines changed

.watchmanconfig

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"ignore_dirs": [
3+
".git",
4+
"node_modules",
5+
"StaticServerExample"
6+
]
7+
}

StaticServerExample/.babelrc

-3
This file was deleted.

StaticServerExample/package-lock.json

+4,091-9,537
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

StaticServerExample/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
"test": "jest"
88
},
99
"dependencies": {
10-
"react": "^16.3.0-alpha.1",
11-
"react-native": "0.54.2",
12-
"react-native-fs": "^2.9.11",
13-
"react-native-static-server": "file:../"
10+
"react": "16.6.3",
11+
"react-native": "0.57.8",
12+
"react-native-fs": "^2.13.3",
13+
"react-native-static-server": "latest"
1414
},
1515
"devDependencies": {
16-
"babel-jest": "23.0.0-alpha.0",
17-
"babel-preset-react-native": "4.0.0",
18-
"jest": "22.4.2",
19-
"react-test-renderer": "^16.3.0-alpha.1"
16+
"babel-jest": "23.6.0",
17+
"jest": "23.6.0",
18+
"metro-react-native-babel-preset": "0.51.1",
19+
"react-test-renderer": "16.6.3"
2020
},
2121
"jest": {
2222
"preset": "react-native"

StaticServerExample/yarn.lock

+1,363-1,429
Large diffs are not rendered by default.

ios/GCDWebServer/Core/GCDWebServer.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2012-2015, Pierre-Olivier Latour
2+
Copyright (c) 2012-2019, Pierre-Olivier Latour
33
All rights reserved.
44
55
Redistribution and use in source and binary forms, with or without
@@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
4242
* GCDWebServerRequest instance created with the same basic info.
4343
* Otherwise, it simply returns nil.
4444
*/
45-
typedef GCDWebServerRequest* _Nullable (^GCDWebServerMatchBlock)(NSString* requestMethod, NSURL* requestURL, NSDictionary* requestHeaders, NSString* urlPath, NSDictionary* urlQuery);
45+
typedef GCDWebServerRequest* _Nullable (^GCDWebServerMatchBlock)(NSString* requestMethod, NSURL* requestURL, NSDictionary<NSString*, NSString*>* requestHeaders, NSString* urlPath, NSDictionary<NSString*, NSString*>* urlQuery);
4646

4747
/**
4848
* The GCDWebServerProcessBlock is called after the HTTP request has been fully
@@ -365,7 +365,7 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess;
365365
*
366366
* Returns NO if the server failed to start and sets "error" argument if not NULL.
367367
*/
368-
- (BOOL)startWithOptions:(nullable NSDictionary*)options error:(NSError** _Nullable)error;
368+
- (BOOL)startWithOptions:(nullable NSDictionary<NSString*, id>*)options error:(NSError** _Nullable)error;
369369

370370
/**
371371
* Stops the server and prevents it to accepts new HTTP requests.
@@ -444,7 +444,7 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess;
444444
*
445445
* @warning This method must be used from the main thread only.
446446
*/
447-
- (BOOL)runWithOptions:(nullable NSDictionary*)options error:(NSError** _Nullable)error;
447+
- (BOOL)runWithOptions:(nullable NSDictionary<NSString*, id>*)options error:(NSError** _Nullable)error;
448448

449449
#endif
450450

@@ -613,7 +613,7 @@ extern NSString* const GCDWebServerAuthenticationMethod_DigestAccess;
613613
*
614614
* Returns the number of failed tests or -1 if server failed to start.
615615
*/
616-
- (NSInteger)runTestsWithOptions:(nullable NSDictionary*)options inDirectory:(NSString*)path;
616+
- (NSInteger)runTestsWithOptions:(nullable NSDictionary<NSString*, id>*)options inDirectory:(NSString*)path;
617617

618618
@end
619619

ios/GCDWebServer/Core/GCDWebServer.m

+76-96
Large diffs are not rendered by default.

ios/GCDWebServer/Core/GCDWebServerConnection.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2012-2015, Pierre-Olivier Latour
2+
Copyright (c) 2012-2019, Pierre-Olivier Latour
33
All rights reserved.
44
55
Redistribution and use in source and binary forms, with or without
@@ -130,7 +130,7 @@ NS_ASSUME_NONNULL_BEGIN
130130
*
131131
* The default implementation returns the original URL.
132132
*/
133-
- (NSURL*)rewriteRequestURL:(NSURL*)url withMethod:(NSString*)method headers:(NSDictionary*)headers;
133+
- (NSURL*)rewriteRequestURL:(NSURL*)url withMethod:(NSString*)method headers:(NSDictionary<NSString*, NSString*>*)headers;
134134

135135
/**
136136
* Assuming a valid HTTP request was received, this method is called before

0 commit comments

Comments
 (0)