Skip to content

Commit

Permalink
Suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
pravinthan committed Jan 22, 2025
1 parent 644dac4 commit 65d2a98
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions TophatModules/Sources/TophatServer/TophatServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,9 @@ public final class TophatServer {
return .internalServerError
}

let queryItems = request.queryParams.map { URLQueryItem(name: $0, value: $1) }
let queryItems = request.queryParams.map { URLQueryItem(name: $0, value: $1.removingPercentEncoding) }

guard let baseURL = baseURL else {
return .internalServerError
}

let encodedURL = baseURL.appending(path: request.path).appending(queryItems: queryItems)
guard let decodedString = encodedURL.absoluteString.removingPercentEncoding else {
return .internalServerError
}
guard let url = URL(string: decodedString) else {
guard let url = baseURL?.appending(path: request.path).appending(queryItems: queryItems) else {
return .internalServerError
}

Expand Down

0 comments on commit 65d2a98

Please sign in to comment.