Fix sym-upload-v2 whitespace in filenames.

- Checking symbol status would fail for files whose names contained spaces, because the file name was being put in the URL unescaped.
- Now the filename is escaped before being put in URL when checking symbol status.

Change-Id: I3b989d877e0fd9aef57ec13bdbbb6c3dacb6a9e2
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2339782
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
This commit is contained in:
Nelson Billing 2020-08-05 11:49:07 -07:00
parent a6218eb66d
commit 3d8daa2c74

View file

@ -70,11 +70,16 @@
withAPIKey:(NSString*)APIKey withAPIKey:(NSString*)APIKey
withDebugFile:(NSString*)debugFile withDebugFile:(NSString*)debugFile
withDebugID:(NSString*)debugID { withDebugID:(NSString*)debugID {
NSString* escapedDebugFile =
[debugFile stringByAddingPercentEncodingWithAllowedCharacters:
[NSCharacterSet URLHostAllowedCharacterSet]];
NSURL* URL = [NSURL NSURL* URL = [NSURL
URLWithString:[NSString URLWithString:[NSString
stringWithFormat:@"%@/v1/symbols/%@/%@:checkStatus" stringWithFormat:@"%@/v1/symbols/%@/%@:checkStatus"
@"?key=%@", @"?key=%@",
APIURL, debugFile, debugID, APIKey]]; APIURL, escapedDebugFile, debugID,
APIKey]];
HTTPGetRequest* getRequest = [[HTTPGetRequest alloc] initWithURL:URL]; HTTPGetRequest* getRequest = [[HTTPGetRequest alloc] initWithURL:URL];
NSError* error = nil; NSError* error = nil;