twitter-archive / diffy

Find potential bugs in your services with Diffy
https://twitter.com/diffyproject
Apache License 2.0
3.83k stars 368 forks source link

Undefined_endpoint #49

Closed sos3443 closed 7 years ago

sos3443 commented 7 years ago

i met a problem and that is when i run diffy i got response ,the URL is 192.168.1.85:31900/v2/products?category_id=kNylmZ and what i saw from the page is Undefined_endpoint.i don't know how to deal with it

diffy1

puneetkhanduri commented 7 years ago

Your test requests need to specify the endpoint name under which their results should be aggregated. This is done by setting the Canonical-Resource header to the endpoint name in all your inbound requests.

See the curl commands in this example.

buzzdan commented 4 years ago

@puneetkhanduri why is it mandatory ? is it possible to parse the endpoint name and use it ? my production requests dont have this header and it could be nice if it would just work out of the box... WDYT ?

puneetkhanduri commented 4 years ago

Hi Dan. Your service probably has multiple endpoints. These endpoints may have path parameters like /users/:userid. This makes it impossible to group request urls into the same logical endpoint for analysis. If we don't group the endpoints, the UI becomes useless because each request may end up creating its own endpoint in the UI with a sample size of 1 rendering Diffy useless. In order to correctly group the traffic into the right logical endpoints, we require this header.

buzzdan commented 4 years ago

@puneetkhanduri thanks for the answer. yes i'm aware of this problem, but whats the alternative? right now i'm throwing an nginx infront of diffy (kinda funny since diffy is a reverse proxy) that only parses the url and adds it as an header. maybe it could be nice to be able to pass a url parsing regex as a parameter ? your example /users/:userid is great since we would only want to capture users right?