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

feat: deprecate getHostname #78

Merged
merged 4 commits into from
Oct 13, 2022
Merged

Conversation

sehnryr
Copy link
Collaborator

@sehnryr sehnryr commented Jun 18, 2022

Proposed changes

Changed the hostname parameter of the cookie management methods by the corresponding url. This will allow a better readability and a better use of these methods.

var hostname = getHostname(url);
Requests.clearStoredCookies(hostname);
Requests.setStoredCookies(hostname, cookies);
Requests.getStoredCookies(hostname);
Requests.addCookie(hostname, name, value);

To:

Requests.clearStoredCookies(url);
Requests.setStoredCookies(url, cookies);
Requests.getStoredCookies(url);
Requests.addCookie(url, name, value);

This was discussed there #76 (comment) and to explain quickly here, getHostname(url) isn't really needed and complexify the use of the other methods unnecessarily.

Type of changes

What types of changes does your code introduce?

Put an x in the boxes that apply.

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have read the CONTRIBUTING doc
  • My code follows the Dart coding convention
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works.
  • I have commented my code, particularly in hard-to-understand areas
  • I have added necessary documentation (if appropriate)

Further comments

It would be nice to be able to pass either the url or the hostname in the methods.

@sehnryr sehnryr marked this pull request as ready for review June 19, 2022 21:14
@sehnryr sehnryr changed the title Improve code readability & useability feat: deprecate getHostname Oct 13, 2022
@sehnryr sehnryr merged commit 0c58077 into jossef:master Oct 13, 2022
@sehnryr sehnryr deleted the improve-code-readability branch October 13, 2022 09:31
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.

None yet

1 participant