Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves an issue where the path key is set to a different path if it… #629

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

lovelgw
Copy link

@lovelgw lovelgw commented Jun 23, 2021

… is duplicated in the URL path

Resolves an issue where the path key is set to a different path if it is duplicated in the URL path

ex >
{
'/product' : 'http://product-service/'
'/example' : 'http://example-service/'
}

call url : http://example.com/example/path/product
match route url : 'http://product-service/'

Motivation and Context

Found a problem as the route key was duplicated in the url path

How has this been tested?

Tested as a component currently under development

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

… is duplicated in the URL path

Resolves an issue where the path key is set to a different path if it is duplicated in the URL path
 
ex > 
{ 
  '/product' : 'http://product-service/'
  '/example' : 'http://product-service/'
}

call url  : http://example.com/example/path/product 
match route url :  'http://product-service/'
@chimurai
Copy link
Owner

another route key is use in url path test
@lovelgw
Copy link
Author

lovelgw commented Jun 23, 2021

Thanks.
Can you add unit test in https://github.com/chimurai/http-proxy-middleware/blob/master/test/unit/router.spec.ts ?

added unit test
describe('matching order of router config', () => { it('should return another route key is use in url path configured', () => { fakeReq.url = '/some/rest/path'; result = getTarget(fakeReq, proxyOptionWithRouter); return expect(result).resolves.toBe('http://localhost:6007'); }); });

Snyk has created this PR to upgrade @types/http-proxy from 1.17.5 to 1.17.6.

See this package in npm:


See this project in Snyk:
https://app.snyk.io/org/lovelgw/project/8d01a776-ebaf-4878-bab0-56d838168105?utm_source=github&utm_medium=upgrade-pr
@lovelgw lovelgw closed this Jun 28, 2021
@lovelgw lovelgw reopened this Jun 28, 2021
@lovelgw lovelgw closed this Jul 30, 2021
@lovelgw lovelgw reopened this Jul 30, 2021
@lovelgw lovelgw closed this Jul 30, 2021
…7694f5ce398

[Snyk] Upgrade @types/http-proxy from 1.17.5 to 1.17.6
@lovelgw lovelgw reopened this Aug 19, 2021
lovelgw and others added 7 commits August 19, 2021 14:51
Snyk has created this PR to upgrade @types/http-proxy from 1.17.6 to 1.17.7.

See this package in npm:


See this project in Snyk:
https://app.snyk.io/org/lovelgw/project/8d01a776-ebaf-4878-bab0-56d838168105?utm_source=github&utm_medium=upgrade-pr
Snyk has created this PR to upgrade is-glob from 4.0.1 to 4.0.2.

See this package in npm:


See this project in Snyk:
https://app.snyk.io/org/lovelgw/project/8d01a776-ebaf-4878-bab0-56d838168105?utm_source=github&utm_medium=referral&page=upgrade-pr
Snyk has created this PR to upgrade micromatch from 4.0.4 to 4.0.5.

See this package in npm:


See this project in Snyk:
https://app.snyk.io/org/lovelgw/project/8d01a776-ebaf-4878-bab0-56d838168105?utm_source=github&utm_medium=referral&page=upgrade-pr
…64c7318ecb1

[Snyk] Upgrade @types/http-proxy from 1.17.6 to 1.17.7
…715bd491de3

[Snyk] Upgrade is-glob from 4.0.1 to 4.0.2
…3d4531d1d75

[Snyk] Upgrade micromatch from 4.0.4 to 4.0.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants