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

optimeize unescape slash path #34934

Merged
merged 22 commits into from
Aug 1, 2024
Merged

Conversation

chenylh
Copy link
Contributor

@chenylh chenylh commented Jun 26, 2024

Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

Signed-off-by: chenylh <chenyuliang@jd.com>
Copy link

Hi @chenylh, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #34934 was opened by chenylh.

see: more, trace.

Signed-off-by: chenylh <chenyuliang@jd.com>
@chenylh chenylh marked this pull request as draft June 27, 2024 01:40
Signed-off-by: chenylh <chenyuliang@jd.com>
Signed-off-by: chenylh <chenyuliang@jd.com>
Signed-off-by: chenylh <chenyuliang@jd.com>
@chenylh chenylh marked this pull request as ready for review June 27, 2024 02:51
Signed-off-by: chenylh <chenyuliang@jd.com>
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
@chenylh chenylh marked this pull request as draft June 27, 2024 08:29
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
@chenylh chenylh marked this pull request as ready for review June 27, 2024 12:14
@mattklein123
Copy link
Member

Seems fine but is this actually faster?

/wait

Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
@nezdolik
Copy link
Member

nezdolik commented Jul 8, 2024

@yanavlasov friendly ping

Copy link
Contributor

@yanavlasov yanavlasov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/wait

unescapeInPath(decoded_path, "%5C", "\\");
unescapeInPath(decoded_path, "%5c", "\\");
headers.setPath(absl::StrCat(decoded_path, query));
std::map<const char*, const char*> replacements;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::map<const char*, const char*> replacements;
static const std::vector<std::pair<absl::string_view, absl::string_view>> replacements{{"2F", "/"}, {"2f", "/"}, ...};

And then remove dynamic initialization below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
Copy link
Contributor

@yanavlasov yanavlasov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks you so much. I just have one more small suggestion. Thanks.

/wait

source/common/http/path_utility.cc Outdated Show resolved Hide resolved
Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
@yanavlasov yanavlasov enabled auto-merge (squash) August 1, 2024 15:21
@yanavlasov yanavlasov merged commit 770fa7b into envoyproxy:main Aug 1, 2024
51 checks passed
martinduke pushed a commit to martinduke/envoy that referenced this pull request Aug 8, 2024
---------

Signed-off-by: chenylh <chenyuliang@jd.com>
Signed-off-by: Martin Duke <martin.h.duke@gmail.com>
asingh-g pushed a commit to asingh-g/envoy that referenced this pull request Aug 20, 2024
---------

Signed-off-by: chenylh <chenyuliang@jd.com>
Signed-off-by: asingh-g <abhisinghx@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants