Skip to content

Commit

Permalink
fix query values in params
Browse files Browse the repository at this point in the history
if you have an url like
```
http://localhost:8080/data/5?query=test&hello=now
```

the value for request.parameters was

```
5?query=test&hello=now
```

this fix, force this value avoiding any query string to be appended.

Now the value is only

```5```
  • Loading branch information
matteocrippa committed Feb 3, 2016
1 parent 0f4495e commit 63e7448
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class Server: SocketServer {
if requestPaths.count > index {
var trimPath = path
trimPath.removeAtIndex(path.startIndex)
request.parameters[trimPath] = requestPaths[index]
request.parameters[trimPath] = requestPaths[index].split("?")[0]
}
}
}
Expand Down Expand Up @@ -114,4 +114,4 @@ public class Server: SocketServer {
return super.dispatch(method, path: path)
}

}
}

0 comments on commit 63e7448

Please sign in to comment.