Skip to content

Enhance redirect detection: add support for meta refresh and JavaScript support#581

Open
qpst4 wants to merge 1 commit into
TrianguloY:masterfrom
qpst4:enhance-redirect-detection
Open

Enhance redirect detection: add support for meta refresh and JavaScript support#581
qpst4 wants to merge 1 commit into
TrianguloY:masterfrom
qpst4:enhance-redirect-detection

Conversation

@qpst4

@qpst4 qpst4 commented Jun 16, 2026

Copy link
Copy Markdown

Enhance Redirect Detection with Meta Refresh and JavaScript Support

Description

This PR adds enhanced redirect detection capabilities to handle complex redirect scenarios that return HTTP 200 status code with hidden redirects in the HTML content.

Features Added

  • HTML Meta Refresh Detection: Now detects and follows <meta http-equiv="refresh"> tags
  • Advanced JavaScript Redirect Detection: Handles multiple JavaScript redirect patterns including:
    • Direct string assignments: window.location = "url"
    • Variable references: window.location = varName (automatically resolves variable definitions)
    • URL-encoded strings with decoding support
    • decodeURIComponent() wrapped URLs
  • URL Decoding: Properly handles URL-encoded characters using URLDecoder
  • Improved URL Resolution: Better handling of relative URLs to absolute URLs

Problem Solved

Previously, URLCheck could not detect redirects that returned HTTP 200 but contained redirect instructions in the HTML body. This is common with URL shorteners and redirect services.

Example Case

URLs like https://kurl06.cn/t8RnP3 that respond with:

<meta http-equiv="refresh" content="0.1;url=https://coupon.m.jd.com/...">with URL decoding

… JavaScript redirect patterns with URL decoding
@github-actions github-actions Bot added the Core Change the core code (set automatically) label Jun 16, 2026
@TrianguloY

Copy link
Copy Markdown
Owner

Hi. I apologize for not saying anything until now, but I have important personal matters to attend, and even though I though they wouldn't take long, it is taking way longer than I expected, I'm sorry.
I noted the pr though, and I do want to review it when I'm back to normal, but I can't say when.

Feel free to ping me if I haven't said anything in a month. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core Change the core code (set automatically)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants