diegorubin/tshield

Mapping a similar path to yml config will match wrong domains

Opened this issue · 0 comments

Describe the bug
Mapping a similar path to tshield.yml will match wrong domains

To Reproduce
Steps to reproduce the behavior:

  1. Define a tshield.yml
domains:

  'http://localhost:9092':
    name: 'customer-backend'
    paths:
      - /users

  'http://localhost:9090':
    name: 'invoice-backend'
    paths:
      - /secure/users
  1. Make a request to /secure/users

Expected behavior
A request should be saved in "invoice-backend/secure-users/get/0.content"

  Scenario: Save response body for similar paths
    Given an api "http://localhost:9092" with path "/users" and name "customer-backend"
    And an api "http://localhost:9090" with path "/secure/users" and name "invoice-backend"
    When "/users" is accessed throught tshield
    And "/secure/users" is accessed throught tshield
    Then response should be saved in "customer-backend/users/get/0.content"
    And response should be saved in "invoice-backend/secure-users/get/0.content"

Additional context

  • TShield version: 0.10.0.0
$ ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin18]