Skip to content

Commit

Permalink
Merge pull request #112 from pushkarnk/url-data
Browse files Browse the repository at this point in the history
Implement HTTPServerRequest.url in a better way
  • Loading branch information
Pushkar N Kulkarni authored Nov 22, 2018
2 parents e9a537a + 5e74110 commit ebdaee3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Sources/KituraNet/HTTP/HTTPServerRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ public class HTTPServerRequest: ServerRequest {
/// Use 'urlURL' for the full URL
public var url : Data {
//The url needs to retain the percent encodings. URL.path doesn't, so we do this.
let components = urlURL.absoluteString.components(separatedBy: "/")
let path = "/" + components.dropFirst(3).joined(separator: "/")
return path.data(using: .utf8) ?? Data()
return _urlString.data(using: .utf8) ?? Data()
}

@available(*, deprecated, message: "URLComponents has a memory leak on linux as of swift 3.0.1. use 'urlURL' instead")
Expand Down

0 comments on commit ebdaee3

Please sign in to comment.