Skip to content

Add invalid url and whitespace url support #10

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

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

AlanDonohoe
Copy link
Contributor

@AlanDonohoe AlanDonohoe commented Nov 21, 2021

What's this PR do?

Adds support and tests to cover invalid URLs and URLs with whitespaces.
Looks like this work was merged in during rebasing...

So now this just renames the function in the test suite testing for handling urls with whitespace, so it's unique.

test_get_successful() -> test_get_successful_white_space_url()

Background context

If a get request is attempted to the UrlBox API with an invalid URL then
an InvalidUrlException is raised, before the call is made to the API.

This allows the user to deal with the invalid URL themselves.

This uses the validator package to validate URLs.

If a URL with whitespace before or after the URL is passed in to the get
request, these are stripped before validation, encoding and finally the
get request is made.

refs:
https://validators.readthedocs.io/en/latest/

@AlanDonohoe AlanDonohoe force-pushed the add-invalid-url-and-whitespace-url-support branch from a006179 to ebbba6c Compare November 22, 2021 13:59
If a get request is attempted to the UrlBox API with an invalid URL then
an InvalidUrlException is raised, before the call is made to the API.

This allows the user to deal with the invalid URL themselves.

This uses the validator package to validate URLs.

If a URL with whitespace before or after the URL is passed in to the get
request, these are stripped before validation, encoding and finally the
get request is made.

refs:
https://validators.readthedocs.io/en/latest/
@AlanDonohoe AlanDonohoe force-pushed the add-invalid-url-and-whitespace-url-support branch from ebbba6c to 0220077 Compare November 22, 2021 14:03
@AlanDonohoe AlanDonohoe merged commit 85c7dea into main Nov 22, 2021
@AlanDonohoe AlanDonohoe deleted the add-invalid-url-and-whitespace-url-support branch November 22, 2021 14:57
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.

1 participant