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

Require full IPv4 address string to be treated as valid URL #616

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

ayoy
Copy link
Contributor

@ayoy ayoy commented Jan 2, 2024

Please review the release process for BrowserServicesKit here.

Required:

Task/Issue URL: https://app.asana.com/0/0/1206262563462715/f
iOS PR: duckduckgo/iOS#2298
macOS PR: duckduckgo/macos-browser#2012
What kind of version bump will this require?: Patch

Description:
When an IPv4-like string is passed to URL constructor, require that it contains 4 octets and otherwise return nil.
This allows clients to fall back to treating the string as search query and constructing search URLs, instead
of making most likely unwanted navigation to an IP address where missing octets are filled with zeros
(e.g. 1.4 -> 1.0.0.4).

Steps to test this PR:

  1. Input 1.4/3.4 in the search bar.
  2. Verify that SERP is displayed (with calculator) and that you're not redirected to http://1.0.0.4/3.4.

OS Testing:

  • iOS 14
  • iOS 15
  • iOS 16
  • macOS 10.15
  • macOS 11
  • macOS 12

Internal references:

Software Engineering Expectations
Technical Design Template

@ayoy ayoy self-assigned this Jan 2, 2024
@ayoy ayoy changed the title Allow calculations in the address bar Require full IPv4 address string to be treated as valid URL Jan 2, 2024
@ayoy ayoy marked this pull request as ready for review January 2, 2024 18:28
@ayoy ayoy requested a review from brindy January 3, 2024 09:39
Copy link
Contributor

@brindy brindy left a comment

Choose a reason for hiding this comment

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

LGTM

@ayoy ayoy merged commit 39a5daf into main Jan 3, 2024
10 checks passed
@ayoy ayoy deleted the dominik/ipv4-parsing branch January 3, 2024 14:36
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