<commit_before>//
//  Request+EndpointType.swift
//  VimeoNetworking
//
//  Created by <NAME> on 10/3/19.
//  Copyright © 2019 Vimeo. All rights reserved.
//

import Foundation

extension Request: EndpointType {

    public var headers: HTTPHeaders? {
        return nil
    }

    // TODO: This method should be able to serialize its own parameters however with the current
    // way the SessionManager is designed we are unable to do that as it would require pretty
    // substantial refactoring. So for now the request serialization is the responsibility of the
    // SessionManaging type [RDPA 10/02/2019].
    public func asURLRequest() throws -> URLRequest {
        guard let url = URL(string: path, relativeTo: baseURL) else {
            throw VimeoNetworkingError.invalidURL
        }
        var urlRequest = URLRequest(url: url)
        headers?.forEach { field, value in
            urlRequest.setValue(value, forHTTPHeaderField: field)
        }
        urlRequest.httpMethod = method.rawValue
        return urlRequest
    }
}<commit_msg>Adds explicit self<commit_after>//
//  Request+EndpointType.swift
//  VimeoNetworking
//
//  Created by <NAME> on 10/3/19.
//  Copyright © 2019 Vimeo. All rights reserved.
//

import Foundation

extension Request: EndpointType {

    public var headers: HTTPHeaders? {
        return nil
    }

    // TODO: This method should be able to serialize its own parameters however with the current
    // way the SessionManager is designed we are unable to do that as it would require pretty
    // substantial refactoring. So for now the request serialization is the responsibility of the
    // SessionManaging type [RDPA 10/02/2019].
    public func asURLRequest() throws -> URLRequest {
        guard let url = URL(string: path, relativeTo: baseURL) else {
            throw VimeoNetworkingError.invalidURL
        }
        var urlRequest = URLRequest(url: url)
        self.headers?.forEach { field, value in
            urlRequest.setValue(value, forHTTPHeaderField: field)
        }
        urlRequest.httpMethod = method.rawValue
        return urlRequest
    }
}
{'fraction_non_alphanumeric': 0.0768143261074458, 'fraction_numerical': 0.016022620169651274, 'mean_word_length': 2.5983050847457627, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7141636', 'n_tokens_mistral': 592, 'n_tokens_neox': 560, 'n_words': 210}