-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add 5 missing attributes to NSURLRequest #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@salgernon - please take a look |
I think we intentionally left these out, but hopefully @salgernon can comment. |
I think it makes sense to have |
If I recall correctly, the reason we left them out is that they are already properties on NSURLSession: /* default cache policy for requests */
public var requestCachePolicy: NSURLRequestCachePolicy
/* default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. */
public var timeoutIntervalForRequest: NSTimeInterval
/* default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. */
public var timeoutIntervalForResource: NSTimeInterval
/* type of service for requests. */
public var networkServiceType: NSURLRequestNetworkServiceType
/* allow request to route over cellular. */
public var allowsCellularAccess: Bool |
That's why
|
get { return super.networkServiceType } | ||
set { super.networkServiceType = newValue } | ||
} | ||
public override var allowsCellularAccess: Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this ever be satisfied? It seems like it would require very specific hardware access
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with leaving allowsCellularAccess
out.
Yes, it was at the request of the owner of this particular API that we do not have this override capability, because they were concerned about the complexity it introduces. However, since we're not really getting any response on this right now, we may as well add this for parity since it's confusing people right now. Let's leave the cellular one out. |
I just noticed that |
259302b
to
e75cae8
Compare
cachePolicy, timeoutInterval, networkServiceType, HTTPBody, and HTTPBodyStream Rework how attributes are stored. Refactor header field code into existingHeaderField(). @parkera did not want allowsCellularAccess.
e75cae8
to
85413a3
Compare
I've removed |
Only after adding |
@swift-ci Please test |
I'll close this. |
C.f. #306 |
[pull] swiftwasm from main
cachePolicy, timeoutInterval, networkServiceType, HTTPBody, and HTTPBodyStream
Rework how attributes are stored.
Refactor header field code into existingHeaderField().