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

Add support for escaped URLs #1642

Merged
merged 13 commits into from
Feb 27, 2019
Merged

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Feb 26, 2019

Revise HttpRequest copy constructor

  • Remove debug warning and revise comment
  • Include postParams in copy
  • Deprecate HttpRequest copy assignment operator
  • Define appropriate copy constructors for HttpHeaders and HttpParams

Revise URL and HttpParams to support escaped text

  • Rename URL to Url - deprecate URL
  • Decompose URL using third-party library libyuarel
  • Integrate escaping/unescaping

Add support for common URL schemes

  • [BC] Rename Protocol to Scheme as per RFC
  • Define common URL schemes in tablular form with default port numbers
  • Replace use of ad-hoc names with URI_SCHEME_*

Other additions

  • Add support for URL fragment
  • Add constructor to Url with individual components
  • Provide implicit String() operator for Url (useful for print, etc.)
  • Add getRelativePath() and getFileName() to simplify application code
  • Revise HttpBodyParser() to un-escape parameter data

…stead

Also copy `postParams` as that is probably intended
Deprecate `HttpRequest` copy assignment operator
Define appropriate copy constructors for `HttpHeaders` and `HttpParams`

Using copy operator on headers unsafe (its' private in HashMap), using setMultiple() will work as expected.
…dise URL schemes

Rename `Protocol` to `Scheme`
Common schemes defined in table with default port numbers
Replace use of ad-hoc names with `URI_SCHEME_*`
Add support for URL fragments
Add constructor to `Url` with individual components
Provide implicit `String()` operator for `Url`
Add `getRelativePath()` and `getFileName()` to simplify application code
@slaff slaff added this to the 3.7.2 milestone Feb 26, 2019
@slaff
Copy link
Contributor

slaff commented Feb 26, 2019

  • [BC] Rename Protocol to Scheme as per RFC

Hm... I guess I should change the next release version from 3.7.2. to 3.8.0. There are already a lot of good improvements and deprecations in it to be treated as a minor release.

this->url.Port = 465;
}
if(this->url.Port == 0) {
this->url.Port = isSecure ? 465 : 25;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can use URI_SCHEME_MAP instead of hard-coding the ports?

@slaff slaff mentioned this pull request Feb 27, 2019
4 tasks

client.connect(URL(dsn));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this PR is almost ready. Just the Readme.md file needs an update.

@slaff
Copy link
Contributor

slaff commented Feb 27, 2019

@mikee47 Is the PR ready and tested or you plan to add something more?

@mikee47
Copy link
Contributor Author

mikee47 commented Feb 27, 2019

@slaff OK, that's everything. I wanted to include an example somewhere for alternative methods of URL construction.

@slaff slaff merged commit adfd36a into SmingHub:develop Feb 27, 2019
@slaff slaff removed the 3 - Review label Feb 27, 2019
@mikee47 mikee47 deleted the feature/url_escaping branch February 27, 2019 11:23
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.

2 participants