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

Crash with Alamofire 5.7.0 and above #2311

Open
PratimaWhirlpool opened this issue May 17, 2023 · 0 comments
Open

Crash with Alamofire 5.7.0 and above #2311

PratimaWhirlpool opened this issue May 17, 2023 · 0 comments
Labels

Comments

@PratimaWhirlpool
Copy link

PratimaWhirlpool commented May 17, 2023

Screenshot 2023-05-17 at 3 52 08 PM Using Moya 15.0.0
public extension Endpoint {
    // swiftlint:disable cyclomatic_complexity
    /// Returns the `Endpoint` converted to a `URLRequest` if valid. Throws an error otherwise.
    func urlRequest() throws -> URLRequest {
        guard let requestURL = Foundation.URL(string: url) else {
            throw MoyaError.requestMapping(url)
        }

        var request = URLRequest(url: requestURL)
        request.httpMethod = method.rawValue
        request.allHTTPHeaderFields = httpHeaderFields

        switch task {

crash with EXE_BAD_ACCESS at task above in alamofire lib for only release configuration
works fine in debug.

Moya current →
case requestParameters(parameters: [String: Any], encoding: ParameterEncoding)
Alamofire.ParameterEncoding

Should also support →
case requestParameters(parameters: [String: Any], encoding: URLEncoding)
Alamofire.URLEncoding

@peril-moya peril-moya bot added the bug? label May 17, 2023
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