RESOLVED FIXED 196809
WKNavigationResponse._downloadAttribute should be nil when no download attribute is present
https://bugs.webkit.org/show_bug.cgi?id=196809
Summary WKNavigationResponse._downloadAttribute should be nil when no download attrib...
Alex Christensen
Reported 2019-04-10 22:35:31 PDT
WKNavigationResponse._downloadAttribute should be nil when no download attribute is present
Attachments
Patch (5.92 KB, patch)
2019-04-10 22:37 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2019-04-10 22:37:14 PDT
David Quesada
Comment 2 2019-04-10 22:54:21 PDT
*** Bug 196806 has been marked as a duplicate of this bug. ***
WebKit Commit Bot
Comment 3 2019-04-10 23:16:06 PDT
Comment on attachment 367205 [details] Patch Clearing flags on attachment: 367205 Committed r244184: <https://trac.webkit.org/changeset/244184>
WebKit Commit Bot
Comment 4 2019-04-10 23:16:08 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 5 2019-04-10 23:17:19 PDT
Darin Adler
Comment 6 2019-04-11 08:50:40 PDT
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.
Darin Adler
Comment 7 2019-04-11 08:51:13 PDT
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.
Note You need to log in before you can comment on or make changes to this bug.