oauth-1.0a icon indicating copy to clipboard operation
oauth-1.0a copied to clipboard

Exclude default ports 80/443 from base URL

Open dinoboff opened this issue 7 years ago • 9 comments

Fix #59

Breaking changes: the URL is validated

dinoboff avatar Dec 23 '17 13:12 dinoboff

too many changes. take me time to review all of them, be patient

ddo avatar Jan 03 '18 10:01 ddo

this PR only "Exclude default ports 80/443 from base URL"? why take 13 files changes

ddo avatar Jan 03 '18 10:01 ddo

@ddo Rebased on master

dinoboff avatar Jan 03 '18 13:01 dinoboff

@ddo

Define parseUrl(url) with the other helpers.

dinoboff avatar Jan 06 '18 12:01 dinoboff

That's crud fix. Maybe we should parse the URL without reg. exp. It would avoid any breaking changes.

dinoboff avatar Jan 06 '18 12:01 dinoboff

i still checking the regex part. any source?

ddo avatar Jan 22 '18 11:01 ddo

Based on https://en.wikipedia.org/wiki/URL (although I just notice the password part of the auth should be optional). The host is optional but required for OAuth request:

/^
  (https?):\/\/      # scheme://
  ([^:]+:[^@]+@)?    # [user[:password]@] (to fix)
  ([^:/?#]+)         # host
  (\:\d+)?           # [:port]
  (\/[^?#]*)?        # [/path]
  (\?[^#]*)?         # [?query]
  (#.*)?             # [#fragment] 
$/

dinoboff avatar Jan 23 '18 14:01 dinoboff

i think we do it too complicated for this simple task?

ddo avatar Jan 25 '18 10:01 ddo

Possibly. We don't need to extract the scheme + port and later the query with the same regexp.

dinoboff avatar Jan 28 '18 22:01 dinoboff