EnableSlashMerge plug-in
When enabled, the EnableSlashMerge plug-in preprocesses an HTTP request by merging adjacent slashes in its path before the request reaches a workload. For example, a path like /a///b is normalized to /a/b. This plug-in requires no configuration fields and takes effect immediately once enabled.
Prerequisites
An ingress gateway is deployed. For more information, see Create an ingress gateway.
-
The httpbin service is deployed in the data plane cluster. For more information, see Deploy the httpbin application.
Configuration example
Verify behavior when disabled
-
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. In the left-side navigation pane, choose .
-
In the Kubernetes Service column, find the IP address of the deployed gateway. Open
http://{gateway_ip}/encoding/utf8in a browser. A page with the title Unicode Demo is displayed. Then, openhttp://{gateway_ip}/encoding///utf8. A page with the title Not Found is displayed. This occurs because the redundant slashes in the path prevent the httpbin service from finding the requested content.
Verify behavior when enabled
-
On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose .
-
On the Plug-in configuration tab, enable the
EnableSlashMergeplug-in and select global as the effective scope. Openhttp://{gateway_ip}/encoding///utf8in a browser. A page with the title Unicode Demo is displayed. The plug-in merges the redundant slashes, allowing the httpbin service to find the correct content.NoteIf you do not see the expected result, it may be due to browser caching. To ensure an accurate test, clear your browser's cache or open a new incognito window.