Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
261 views
in Technique[技术] by (71.8m points)

Azure API Management does not match incoming request url to uri template when contains encoded hash

Due to certain customer requirements our Azure API Management must be able to handle GET requests with URLs containing hash signs (#). Alas, I can't find a way to make it work.

So, let's imagine there is a following url template: /products/{id}/items, where {id} is a string which may contain #.

What I did is that {id} is encoded when called from the web application, so example call to the APIM is: https://contoso.apim.com/products/some%23id/items, where %23 is encoded # sign.

Such url is handled correctly when used against actual API (which, btw. is a .net core 3 api deployed to Service Fabric cluster), however when used via APIM management, request returns 404 FABRIC_E_SERVICE_DOES_NOT_EXIST error.
If I were to replace %23 with any other encoded value, e.g. %20, uri template would be correctly matched and hit underlying API.

After running some APIM request traces, I can definitely confirm that url thats being forwarded to the backend from APIM is not trimmed or changed in any way.

Any suggestion how to solve this would be much appreciated.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.7k users

...