Skip to content

Commit

Permalink
Return empty string when we have no response headers; fix phoboslab#533
Browse files Browse the repository at this point in the history
  • Loading branch information
phoboslab committed Aug 2, 2015
1 parent fc15954 commit fa035d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Source/Ejecta/EJUtils/EJBindingHttpRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,12 @@ - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
}

EJ_BIND_FUNCTION(getAllResponseHeaders, ctx, argc, argv) {
if( !response || ![response isKindOfClass:[NSHTTPURLResponse class]] ) {
if( !response ) {
return NULL;
}
if( ![response isKindOfClass:[NSHTTPURLResponse class]] ) {
NSStringToJSValue(ctx, @"");
}

NSHTTPURLResponse *urlResponse = (NSHTTPURLResponse *)response;
NSMutableString *headers = [NSMutableString string];
Expand Down

0 comments on commit fa035d0

Please sign in to comment.