All Products
Search
Document Center

Alibaba Cloud Service Mesh:EnableSlashMerge plug-in

Last Updated:Jan 20, 2025

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

Configuration example

Test an access when EnableSlashMerge is disabled

  1. Log on to the ASM console. In the left-side navigation pane, choose Service Mesh > Mesh Management.

  2. On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose ASM Gateways > Ingress Gateway.

  3. 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 access http://{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

  1. On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose Plugin Extension Center > Market Place.

  2. In the Plug-in Configuration tab, enable the EnableSlashMerge plug-in, and select Global as the scope where the plug-in takes effect. Use a browser to access http://{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.

    Note

    The 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.