After enabling the EnableSlashMerge plug-in, the sidecar or gateway preprocesses an HTTP request and merge contiguous slashes in the IP address into one before the request reaches service workloads. For example, /a///b is modified to /a/b. This plug-in can be enabled directly without any configuration.
Prerequisites
An ingress gateway is deployed. For more information, see Create an ingress gateway.
The HTTPBin service has been deployed in the data plane cluster. For more information, see Deploy the HTTPBin application.
Configuration example
Test an access when EnableSlashMerge is 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, get the IP address of the deployed gateway. Use a browser to access
http://{gateway ip}/encoding/utf8, and you will see a page titled Unicode Demo. Use a browser to accesshttp://{gateway ip}/encoding///utf8, and you will see a page titled Not Found. In this case, the redundant slashes in the IP address hinder the HTTPBin service to find the requested content.
Test an access when EnableSlashMerge is enabled
On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose .
In the Plug-in Configuration tab, enable the
EnableSlashMergeplug-in, and select Global as the scope where the plug-in takes effect. Use a browser to accesshttp://{gateway ip}/encoding///utf8, and you will see a page titled Unicode Demo. In this case, the plug-in has merged the redundant slashes in advance, allowing the httpbin service to find the requested content.NoteThe caching behavior of a browser may result in unexpected access results. You can clear the browser cache or open a new incognito window before trying again.