Skip to content

Inconsistency in getPath & getPathAndQuery returns #767

@aleks-f

Description

@aleks-f

From forum:

postby mfkilian » Thu Apr 02, 2015 1:07 pm

The strings returned from URI::getPath and URI::getPathAndQuery seem inconsistent:

#include <iostream>
using namespace std;
#include "Poco/URI.h"

int main(int argc, char *argv[]) {
Poco::URI x("/a%20b/c.mp4");

cout << "getPath() = '" << x.getPath() << "'" << endl;
cout << "getPathAndQuery() = '" << x.getPathAndQuery() << "'" << endl;
}
getPath() = '/a b/c.mp4'
getPathAndQuery() = '/a%20b/c.mp4'

Why is getPath() returning decoded content but getPathAndQuery returning the original (encoded) content? It seems inconsistent. It is also not apparent that there is an equivalent of getRawQuery for Path, i.e., getRawPath -- a way to get the original encoded version.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions