AppBlade / AppBladeSDK

The SDK for AppBlade; iOS and Android
https://appblade.com
MIT License
23 stars 14 forks source link

Multipart boundaries #21

Closed andrewtremblay closed 11 years ago

andrewtremblay commented 11 years ago

Switched static string for boundaries into a randomized one for safety. Removed console logging in feedback due to extreme size. Feedback and Crashes now can take optional user-defined params out of a plist and send them to Appblade to be stored and viewed later.

andrewtremblay commented 11 years ago

this pull should close issues #14, #17, #19, and #20

andrewtremblay commented 11 years ago

The old customParams functionality snuck in as well. You'll have to okay those as well, @spitz .

spitz commented 11 years ago

Its not necesarily part of this pull request, but the following code has a leak in it:

+ (NSString *)buildHostURL:(NSString *)customURLString
{
    NSString* preparedHostName = nil;
    if(customURLString == nil){
        NSLog(@"No custom URL: defaulting to %@", defaultAppBladeHostURL);
        preparedHostName = defaultAppBladeHostURL;
    }
    else
    {
        //build a request to check if the supplied url is valid

///////////////////////////////////////////////
// HERE!!! The Leak is HERE. You've got an alloc/init without an autorelease or release.
///////////////////////////////////////////////

        NSURL *requestURL = [[NSURL alloc] initWithString:customURLString];
        if(requestURL == nil)
        {
            NSLog(@"Could not parse given URL: %@ defaulting to %@", customURLString, defaultAppBladeHostURL);
            preparedHostName = defaultAppBladeHostURL;
        }
        else
        {
            NSLog(@"Found custom URL %@", customURLString);
            preparedHostName = customURLString;
        }
    }
    NSLog(@"built host URL: %@", preparedHostName);
    return preparedHostName;
}
spitz commented 11 years ago

There's also a leak in encodeBase64WithData. We need to call free(*objPointer) after we construct the NSString we're currently returning.