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

Implement HTTPServerRequest.url in a better way #112

Merged
merged 1 commit into from Nov 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions Sources/KituraNet/HTTP/HTTPServerRequest.swift
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