You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/12/30 12:11:30 UTC

[GitHub] [apisix-dashboard] liuxiran opened a new pull request #1164: fix: input validate for online debug url

liuxiran opened a new pull request #1164:
URL: https://github.com/apache/apisix-dashboard/pull/1164


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bugfix
   
   - Related issues
   part of #1077 
   ___
   ### Bugfix
   - How to fix?
   add a Regular Expression to test whether the input url is legal.
   ___
   ### New feature or improvement
   - Describe the details and related test reports.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io commented on pull request #1164: fix: input validate for online debug url

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #1164:
URL: https://github.com/apache/apisix-dashboard/pull/1164#issuecomment-752519750


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=h1) Report
   > Merging [#1164](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=desc) (6ec6efc) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/45d79b674c2f500d76b76939674b6792201a70bb?el=desc) (45d79b6) will **decrease** coverage by `0.05%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1164/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1164      +/-   ##
   ==========================================
   - Coverage   42.30%   42.25%   -0.06%     
   ==========================================
     Files          31       31              
     Lines        1924     1924              
   ==========================================
   - Hits          814      813       -1     
   - Misses       1000     1001       +1     
     Partials      110      110              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1164/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `79.37% <0.00%> (-0.63%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=footer). Last update [45d79b6...6ec6efc](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1164: fix: input validate for online debug url

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1164:
URL: https://github.com/apache/apisix-dashboard/pull/1164#issuecomment-752519750


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=h1) Report
   > Merging [#1164](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=desc) (b84c282) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/a34317193cece2532ed333aaaacfd3a6af7328c4?el=desc) (a343171) will **increase** coverage by `0.05%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1164/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1164      +/-   ##
   ==========================================
   + Coverage   42.27%   42.32%   +0.05%     
   ==========================================
     Files          31       31              
     Lines        1928     1928              
   ==========================================
   + Hits          815      816       +1     
   + Misses       1002     1001       -1     
     Partials      111      111              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1164/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `80.00% <0.00%> (+0.62%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=footer). Last update [a343171...b84c282](https://codecov.io/gh/apache/apisix-dashboard/pull/1164?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #1164: fix: input validate for online debug url

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1164:
URL: https://github.com/apache/apisix-dashboard/pull/1164#issuecomment-752529954


   Because I removed the husky days ago, due to it couldn't find the right `.git`, so those codes will not be linted when committing.
   
   here has 1 tip, https://github.com/apache/apisix-dashboard/blob/master/web/package.json#L41 .
   
   ```sh
   yarn prettier --write .
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1164: fix: input validate for online debug url

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1164:
URL: https://github.com/apache/apisix-dashboard/pull/1164#discussion_r550177546



##########
File path: web/src/pages/Route/components/DebugViews/DebugDrawView.tsx
##########
@@ -119,7 +119,8 @@ const DebugDrawView: React.FC<RouteModule.DebugDrawProps> = (props) => {
   };
 
   const handleDebug = (url: string) => {
-    if (url === '') {
+    const urlReg = /^(?=^.{3,255}$)(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+\.\w+)*([\?&]\w+=\w*)*$/;

Review comment:
       ![image](https://user-images.githubusercontent.com/2106987/103351148-39083880-4add-11eb-8d20-7fbb19e7ff8d.png)
   
   Wow




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #1164: fix: input validate for online debug url

Posted by GitBox <gi...@apache.org>.
liuxiran commented on a change in pull request #1164:
URL: https://github.com/apache/apisix-dashboard/pull/1164#discussion_r550184456



##########
File path: web/src/pages/Route/components/DebugViews/DebugDrawView.tsx
##########
@@ -119,7 +119,8 @@ const DebugDrawView: React.FC<RouteModule.DebugDrawProps> = (props) => {
   };
 
   const handleDebug = (url: string) => {
-    if (url === '') {
+    const urlReg = /^(?=^.{3,255}$)(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+\.\w+)*([\?&]\w+=\w*)*$/;

Review comment:
       > ![image](https://user-images.githubusercontent.com/2106987/103351148-39083880-4add-11eb-8d20-7fbb19e7ff8d.png)
   > 
   > Wow
   
   love this picture~! current reg has some errors, updating




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan merged pull request #1164: fix: input validate for online debug url

Posted by GitBox <gi...@apache.org>.
juzhiyuan merged pull request #1164:
URL: https://github.com/apache/apisix-dashboard/pull/1164


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org