Meshery: The validation for protocol in URL donst allow urls without top level domain.

Created on 3 Sep 2020  路  14Comments  路  Source: layer5io/meshery

Description

The protocol wont consider http://172.17.0.2:31329/productpage as a vaild URL as it lacks a top level domain.
Rather it would accept http://172.17.0.2:31329.com/productpage
Expected Behavior

Screenshots

image

componenui kinbug

Most helpful comment

@dhruv0000 , Shubham has been so nice. We set up a zoom call and walked me through. I totally understand what was done now. I want to set up my development environment so that I can test the changes myself.

All 14 comments

@dhruv0000 I guess this is an error of regex being used for URL validation, I guess this regex should work fine

export const compulsoryProtocolValidUrlPattern = new RegExp('^(https?:\\/\\/)' // compulsory protocol
  + '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' // domain name
  + '((\\d{1,3}\.){3}\\d{1,3}))' // OR ip (v4) address
  + '(\\:\\d+)?(\/[-a-z\\d%_.~+]*)*' // port and path
  + '(\\?[;&a-z\\d%_.~+=-]*)?' // query string
  + '(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator

Hmmn. I'm trying to understand this issue

@kushthedude are you saying this regular expression you just provided will work? If yes, where should it be added?

I checked the regex. It should work. As for where the place where the regex is matched, you can find it in the MesheryPerformanceComponent @KarenEfereyan

Hello everyone. @KarenEfereyan are you working on this issue? If not, can I work on it?

@shubhamgupta2956 i want to but im not sure how to. You can take it up but can i learn from you?

Yeah sure @KarenEfereyan. @kushthedude, @dhruv0000 can you please assign this issue to me?

@shubhamgupta2956 it to you. Can we talk on slack? So i see how you solve it

Yeah sure. I am Shubham Gupta on slack also :slightly_smiling_face:

Sure @shubhamgupta2956 . Ping me on slack if you both are still confused. @shubhamgupta2956 @KarenEfereyan

@dhruv0000 definitely

@dhruv0000 , Shubham has been so nice. We set up a zoom call and walked me through. I totally understand what was done now. I want to set up my development environment so that I can test the changes myself.

@dhruv0000 I have made a PR #1583. Please review it :slightly_smiling_face:

Great @shubhamgupta2956 . @KarenEfereyan you can checkout the UI contribution flow to setup your environment.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leecalcote picture leecalcote  路  3Comments

hexxdump picture hexxdump  路  4Comments

leecalcote picture leecalcote  路  4Comments

leecalcote picture leecalcote  路  4Comments

sakomws picture sakomws  路  4Comments