diff options
author | Håvard Pettersen <havardpe@oath.com> | 2019-01-14 11:14:57 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2019-01-14 11:14:57 +0000 |
commit | 7f11bbcde650ab299fb319212133c42bf91a4ec0 (patch) | |
tree | bd3b6673c37d890d2c5a30dd05609c0f2e5e88c2 /storage | |
parent | 8b57fffd5dd15bf5da117191cf40d443a967b5c0 (diff) |
improve path/query handling
- return attributes by value to avoid referencing deconstructed objects.
- use path/query form portal request to avoid dequoting issues
- log raw uri instead of dequoted non-parsed uri
Diffstat (limited to 'storage')
-rw-r--r-- | storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp b/storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp index 2f6346c91b9..d281b728781 100644 --- a/storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp +++ b/storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp @@ -118,20 +118,8 @@ StatusWebServer::WebServer::get(vespalib::Portal::GetRequest request) void StatusWebServer::WebServer::handle_get(vespalib::Portal::GetRequest request) { - const vespalib::string &tmpurl = request.get_uri(); - Fast_URL urlCodec; - int bufLength = tmpurl.length() * 2 + 10; - char * encodedUrl = new char[bufLength]; - strcpy(encodedUrl, tmpurl.c_str()); - char decodedUrl[bufLength]; - urlCodec.DecodeQueryString(encodedUrl); - urlCodec.decode(encodedUrl, decodedUrl, bufLength); - delete [] encodedUrl; - - vespalib::string url = decodedUrl; - - LOG(debug, "Status got get request '%s'", url.c_str()); - framework::HttpUrlPath urlpath(url.c_str(), request.get_host()); + LOG(debug, "Status got get request '%s'", request.get_uri().c_str()); + framework::HttpUrlPath urlpath(request.get_path(), request.export_params(), request.get_host()); _status.handlePage(urlpath, std::move(request)); } |