You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Linux (tested with swift 5.1.4) the following (just at the lldb prompt will do) returns a valid chunk of data with no exception thrown. The data, if converted to a string, is Apple's 404 page.
I think (and I'm looking at _NSNonfileURLContentLoader) that it's just not inspecting the http response status codes. Given that there's no way for my app to know it's a 404 by inspecting the returned Data object this is incorrect behaviour.
Additional Detail from JIRA
md5: 03d8ad5d55e56dd90fabb52c02670331
Issue Description:
On Linux (tested with swift 5.1.4) the following (just at the lldb prompt will do) returns a valid chunk of data with no exception thrown. The data, if converted to a string, is Apple's 404 page.
(lldb) p Data(contentsOf:URL(string:"https://www.apple.com/a404/")!)
(Data) $R14 = 35006 bytes
On MacOS the same thing throws an exception.
I think (and I'm looking at _NSNonfileURLContentLoader) that it's just not inspecting the http response status codes. Given that there's no way for my app to know it's a 404 by inspecting the returned Data object this is incorrect behaviour.
For completeness curl confirms it's a 404 🙂
$ curl https://www.apple.com/a404/ -vvvv
...snip..
< HTTP/2 404
< server: Apache
< x-frame-options: SAMEORIGIN
< x-xss-protection: 1; mode=block
< x-content-type-options: nosniff
<
The text was updated successfully, but these errors were encountered: