WKNavigationResponse._downloadAttribute should be nil when no download attribute is present
Created attachment 367205 [details] Patch
*** Bug 196806 has been marked as a duplicate of this bug. ***
Comment on attachment 367205 [details] Patch Clearing flags on attachment: 367205 Committed r244184: <https://trac.webkit.org/changeset/244184>
All reviewed patches have been landed. Closing bug.
<rdar://problem/49803597>
Comment on attachment 367205 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367205&action=review > Source/WebKit/UIProcess/API/Cocoa/WKNavigationResponse.mm:84 > - return _navigationResponse->downloadAttribute(); > + const String& attribute = _navigationResponse->downloadAttribute(); > + return attribute.isNull() ? nil : (NSString *)attribute; The function nsStringNilIfEmpty from WTFString.h was designed for uses like this one. I admit it does not have a beautiful name, but this is exactly what it’s for.
Comment on attachment 367205 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367205&action=review >> Source/WebKit/UIProcess/API/Cocoa/WKNavigationResponse.mm:84 >> + return attribute.isNull() ? nil : (NSString *)attribute; > > The function nsStringNilIfEmpty from WTFString.h was designed for uses like this one. I admit it does not have a beautiful name, but this is exactly what it’s for. Oops, no, this is "nil if null", which is not the same thing. Sorry.