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

RF: linked pages #47

Merged
merged 3 commits into from
Jun 15, 2024
Merged

RF: linked pages #47

merged 3 commits into from
Jun 15, 2024

Conversation

vleong99
Copy link
Contributor

  • Moved linked pages to checks
  • Added tests for logic-handling and for the linked pages handler. Tests use a mock client instead of making an actual GET request to avoid flakiness
    • NOTE: The resolveURL function parses hrefs in the same way a browser would, which can lead to some unintuitive outcomes. I have left a comment by that function with further explanation and added some test cases for illustration
  • Modified the sortURLsByFrequency function to ensure that results are deterministic
  • Modified the walkDom function to ensure that "www" subdomains are disregarded when determining if a link is internal (previously, "www.google.com" would be considered an external link to "google.com", which seems like incorrect behaviour)

@vleong99 vleong99 requested a review from Lissy93 as a code owner June 14, 2024 12:03
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

Attention: Patch coverage is 81.25000% with 15 lines in your changes missing coverage. Please review.

Flag Coverage Δ
unittests 59.43% <81.25%> (+1.70%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
handlers/linked_pages.go 100.00% <100.00%> (+33.33%) ⬆️
server/server.go 84.21% <100.00%> (ø)
checks/checks.go 0.00% <0.00%> (ø)
checks/linked_pages.go 86.88% <86.88%> (ø)

Copy link
Member

@Lissy93 Lissy93 left a comment

Choose a reason for hiding this comment

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

Thanks, this looks awesome 🙌

@Lissy93 Lissy93 merged commit 387d79f into xray-web:main Jun 15, 2024
3 checks passed
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.

3 participants