Path normalization allows you to represent paths in a more efficient and clearer manner. This topic describes the path normalization policies of Service Mesh (ASM) and how to configure a path normalization policy.
Background information
The path information of HTTP requests is critical for ASM to process the requests. For example, you may use authorization policies to provide security protection for workloads in a Kubernetes cluster. However, requests may be unexpectedly rejected by proxies in ASM if the request paths do not conform to specifications, which may lead to security risks of services in the cluster. You can configure a path normalization policy to ensure that the paths of HTTP requests in ASM are always standardized. HTTP request paths are normalized by sidecar proxies based on the policy.
Procedure
Log on to the ASM console. In the left-side navigation pane, choose .
On the Mesh Management page, click the name of the ASM instance that you want to manage. On the Base Information page, find Path Normalization Policy in the Config Info section and click Edit on the right side.
In the dialog box that appears, select a path normalization policy and click OK. The following table describes the path normalization policies of ASM.
Path normalization policy
Description
NONE
Path normalization is not performed.
BASE
Path normalization is performed according to RFC 3986. For example,
/a/../b
is normalized to/b
.MERGE_SLASHES
Path normalization is performed according to the BASE policy, and then adjacent slashes are merged. For example,
/a//b
is normalized to/a/b
.DECODE_AND_MERGE_SLASHES
First, path normalization is performed according to the MERGE_SLASHES policy. Then, characters on a path are UTF-8 decoded. Finally, adjacent slashes are merged. This means that
%2F
,%21
,%5C
, and%5C
will be translated into/
and\
characters. For example,/a%21/b
is normalized to/a/b
.