Skip to content

Commit 2b9f245

Browse files
committed
Add case to handle redirect by using JavaScript to pass test suites
1 parent 502febb commit 2b9f245

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test-directory-structure.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
class Parser(HTMLParser):
1717
"""
18+
<h1>Redirecting&hellip;</h1> または
1819
<meta http-equiv="refresh"> を含むファイルを検査の対象から除外する
1920
"""
2021

@@ -34,6 +35,10 @@ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None
3435
self.is_redirect = True
3536
break
3637

38+
def handle_data(self, data: str) -> None:
39+
if "Redirecting" in data:
40+
self.is_redirect = True
41+
3742

3843
def is_redirect(path: str) -> bool:
3944
with open(path) as fp:

0 commit comments

Comments
 (0)