Compare commits
2 Commits
Kordophone
...
Kordophone
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a3303da06 | |||
| 641e4c53fa |
13
Makefile
Normal file
13
Makefile
Normal file
@@ -0,0 +1,13 @@
|
||||
INSTALL_PATH := /usr/share/kordophone
|
||||
|
||||
build/Release/kordophoned:
|
||||
xcodebuild
|
||||
|
||||
.PHONY: install
|
||||
install: build/Release/kordophoned
|
||||
install -d $(INSTALL_PATH)
|
||||
install build/Release/kordophoned $(INSTALL_PATH)
|
||||
cp -rf build/Release/CocoaHTTPServer.framework $(INSTALL_PATH)
|
||||
|
||||
clean:
|
||||
rm -Rf build
|
||||
@@ -60,9 +60,14 @@
|
||||
MBIMAuthToken *token = [[MBIMAuthToken alloc] initWithUsername:username];
|
||||
|
||||
// All systems go
|
||||
response = [MBIMJSONDataResponse responseWithJSONObject:@{
|
||||
MBIMJSONDataResponse *dataResponse = [MBIMJSONDataResponse responseWithJSONObject:@{
|
||||
@"jwt" : token.jwtToken
|
||||
}];
|
||||
|
||||
// Send a cookie down so we can use httpOnly cookies
|
||||
dataResponse.httpHeaders[@"Set-Cookie"] = [NSString stringWithFormat:@"auth_token=%@", token.jwtToken];
|
||||
|
||||
response = dataResponse;
|
||||
} while (NO);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MBIMDataResponse : HTTPDataResponse
|
||||
@property (nonatomic, readonly) NSMutableDictionary *httpHeaders;
|
||||
- (instancetype)initWithData:(NSData *)data contentType:(NSString *)contentType;
|
||||
@end
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
@implementation MBIMDataResponse {
|
||||
NSString *_contentType;
|
||||
NSMutableDictionary *_httpHeaders;
|
||||
}
|
||||
|
||||
- (instancetype)initWithData:(NSData *)data contentType:(NSString *)contentType
|
||||
@@ -17,6 +18,9 @@
|
||||
self = [super initWithData:data];
|
||||
if (self) {
|
||||
_contentType = contentType;
|
||||
_httpHeaders = [@{
|
||||
@"Content-Type" : _contentType ?: @"application/octet-stream"
|
||||
} mutableCopy];
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -24,9 +28,7 @@
|
||||
|
||||
- (NSDictionary *)httpHeaders
|
||||
{
|
||||
return @{
|
||||
@"Content-Type" : _contentType ?: @"application/octet-stream"
|
||||
};
|
||||
return _httpHeaders;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user