Skip to content
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

can't catch custom Session when set URLSessionConfiguration protocolClasses #238

Open
Hflydragon opened this issue Jul 11, 2022 · 1 comment
Labels

Comments

@Hflydragon
Copy link

Describe the bug
when i used custom Session, set protocolClasses, it doesn't work.

@Hflydragon Hflydragon added the bug label Jul 11, 2022
@Hflydragon
Copy link
Author

here config.protocolClasses something errors use? why not use protocolClasses_Swizzled

`@objc private class var default_swizzled: URLSessionConfiguration {
get {
let config = URLSessionConfiguration.default_swizzled

        // Let's go ahead and add in NFXProtocol, since it's safe to do so.
        config.protocolClasses?.insert(NFXProtocol.self, at: 0)
        
        return config
    }
}

@objc private class var ephemeral_swizzled: URLSessionConfiguration {
    get {
        let config = URLSessionConfiguration.ephemeral_swizzled
        
        // Let's go ahead and add in NFXProtocol, since it's safe to do so.
        config.protocolClasses?.insert(NFXProtocol.self, at: 0)
        
        return config
    }
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant