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

fix: support uri/host/remote_addr #2046

Merged
merged 7 commits into from
Aug 10, 2021
Merged

Conversation

Baoyuantop
Copy link
Contributor

Please answer these questions before submitting a pull request, or your PR will get closed.

Why submit this pull request?

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What changes will this PR take into?

When creating a route, if Host, Path, and Remote Addrs have a single value, send uri/host/remote_addr to the API, and send uris/hosts/remote_addrs if there are multiple values.

Related issues

resolve #2013

Checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@netlify
Copy link

netlify bot commented Aug 7, 2021

✔️ Deploy Preview for apisix-dashboard ready!

🔨 Explore the source changes: 1815a17

🔍 Inspect the deploy log: https://app.netlify.com/sites/apisix-dashboard/deploys/61121dd48250b6000737ddbf

😎 Browse the preview: https://deploy-preview-2046--apisix-dashboard.netlify.app

@liuxiran
Copy link
Contributor

liuxiran commented Aug 7, 2021

Hi @Baoyuantop please fix ci problem when you have time, thanks

@codecov-commenter
Copy link

codecov-commenter commented Aug 8, 2021

Codecov Report

Merging #2046 (1815a17) into master (930e47a) will increase coverage by 0.24%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2046      +/-   ##
==========================================
+ Coverage   65.94%   66.18%   +0.24%     
==========================================
  Files         121      121              
  Lines        3212     3226      +14     
  Branches      779      787       +8     
==========================================
+ Hits         2118     2135      +17     
+ Misses       1094     1091       -3     
Flag Coverage Δ
frontend-e2e-test 66.18% <100.00%> (+0.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
web/src/components/Plugin/UI/limit-conn.tsx 100.00% <100.00%> (ø)
web/src/components/Plugin/UI/plugin.tsx 83.33% <100.00%> (ø)
web/src/pages/Route/components/Step1/MetaView.tsx 100.00% <100.00%> (ø)
web/src/pages/Route/transform.ts 74.46% <100.00%> (+1.74%) ⬆️
...pages/Route/components/Step1/RequestConfigView.tsx 86.79% <0.00%> (+5.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0dfcb4...1815a17. Read the comment docs.

@juzhiyuan
Copy link
Member

@liuxiran Could you please give some test cases so we could test them in this PR?

@liuxiran
Copy link
Contributor

liuxiran commented Aug 8, 2021

test cases should cover @Baoyuantop

  1. create a route in UI with uri remote_addr host, Intercept response body to see if they are as expected
  2. create a route in UI with uris remote_addrs hosts, Intercept response body to see if they are as expected
  3. both of them need to test the configure UI are as expected

cc @juzhiyuan

@juzhiyuan
Copy link
Member

And if the origin uri is test.com, then you change it to test.com, test1.com, then it should pass uris.

@Baoyuantop
Copy link
Contributor Author

test cases should cover @Baoyuantop

  1. create a route in UI with uri remote_addr host, Intercept response body to see if they are as expected
  2. create a route in UI with uris remote_addrs hosts, Intercept response body to see if they are as expected
  3. both of them need to test the configure UI are as expected

cc @juzhiyuan

Can Intercept response body be replaced by Intercept Raw Data when created? @liuxiran

@juzhiyuan
Copy link
Member

I think it's ok :)

@juzhiyuan
Copy link
Member

cc @iamayushdas @guoqqqi to have a review when you have time

@juzhiyuan juzhiyuan requested a review from bzp2010 August 9, 2021 04:29
@liuxiran
Copy link
Contributor

@Baoyuantop please fix the conflict files first

@juzhiyuan juzhiyuan merged commit 725accf into apache:master Aug 10, 2021
@Baoyuantop Baoyuantop deleted the fix-route-uri branch August 10, 2021 08:41
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.

support uri & uris, host & hosts, remote_addr & remote_addrs
7 participants