mirror of
https://github.com/goodhosts/hostsfile.git
synced 2026-04-27 07:25:53 +03:00
[PR #25] [CLOSED] hostsperline fixing, moves slice funcs to slice.go, add testing #35
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hostsfile#35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/goodhosts/hostsfile/pull/25
Author: @luthermonson
Created: 11/30/2021
Status: ❌ Closed
Base:
master← Head:windows-hostsperline📝 Commits (3)
5d51567update ci workflow + bump go to 1.1719c3246hostsperline fixing, moves slice funcs to slice.go, add testing799ff47vendor📊 Changes
72 files changed (+23065 additions, -97 deletions)
View changed files
📝
.github/workflows/ci.yml(+6 -12)➖
const.go(+0 -9)➖
const_windows.go(+0 -7)📝
go.mod(+12 -2)📝
go.sum(+15 -2)📝
hosts.go(+25 -8)📝
hosts_test.go(+25 -0)📝
hostsline.go(+1 -1)➕
slice.go(+29 -0)📝
slice_test.go(+0 -0)📝
utils.go(+7 -48)➕
utils_windows.go(+12 -0)➕
vendor/github.com/asaskevich/govalidator/.gitignore(+15 -0)➕
vendor/github.com/asaskevich/govalidator/.travis.yml(+12 -0)➕
vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md(+43 -0)➕
vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md(+63 -0)➕
vendor/github.com/asaskevich/govalidator/LICENSE(+21 -0)➕
vendor/github.com/asaskevich/govalidator/README.md(+622 -0)➕
vendor/github.com/asaskevich/govalidator/arrays.go(+87 -0)➕
vendor/github.com/asaskevich/govalidator/converter.go(+81 -0)...and 52 more files
📄 Description
problem: windows has some limits to how many hosts it can have per line and we've seen more issues with 255 char dns limits
fix: rework flush to include a preFlushClean which targets windows/linux. linux is a noop but on windows we will force a 9 hosts per line limit. To accommodate this we have to add a
RemoveDuplicateIpsat the top of each HostsPerLine call to reset the internal hosts.Lines slice so that the 9/line limit is upheld. A developer who wants to override this can change the const HostsPerLine but use at your own risk on windows with values > 9important: added a dns name validator which restricts > 255chars and has a regex to make sure weird special chars etc.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.