imgix / imgix-objc

Official imgix Objective-C client.
MIT License
29 stars 3 forks source link

Does not work if token and no query specified #3

Closed simsea closed 8 years ago

simsea commented 9 years ago

in IGXClient - (NSString )queryStringWithPath:(NSString )path

needs to be:

    NSString *input;
    if (nil != query && 0 != query.length)
        input = [[NSString alloc] initWithFormat:@"%@%@?%@", self.token, path, query];
    else
        input = [[NSString alloc] initWithFormat:@"%@%@", self.token, path];

instead of NSString *input = [[NSString alloc] initWithFormat:@"%@%@?%@", self.token, path, query];

In the existing code, if query is empty, it adds a '?' at the end of the encoder input string which leads to the wrong encoded string.

paulstraw commented 8 years ago

Hey @simsea, should be all better as of #7. Let me know if you're still seeing any issues around this!