diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index 07247318..52aca62e 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -16,11 +16,6 @@ import pytest if TYPE_CHECKING: from playwright.sync_api import Page, Response, Route -CDNJS_TABULATOR_ASSETS = { - 'https://cdnjs.cloudflare.com/ajax/libs/tabulator-tables/6.5.2/css/tabulator.min.css', - 'https://cdnjs.cloudflare.com/ajax/libs/tabulator-tables/6.5.2/js/tabulator.min.js', -} - class HarvestViewServer: def __init__(self, repo_root: Path, port: int, environment: dict[str, str], server_log: Path) -> None: @@ -103,9 +98,6 @@ class BrowserFailures: def _guard_request(self, route: Route) -> None: request = route.request parsed = urlsplit(request.url) - if request.url in CDNJS_TABULATOR_ASSETS: - route.continue_() - return if parsed.scheme not in {'http', 'https'} or parsed.hostname == 'localhost': route.continue_() return diff --git a/tests/lib/test_harvestview_ui.py b/tests/lib/test_harvestview_ui.py index 5a8fee13..42375f92 100644 --- a/tests/lib/test_harvestview_ui.py +++ b/tests/lib/test_harvestview_ui.py @@ -75,7 +75,7 @@ def test_harvestview_offers_jsonl_and_sqlite_imports_with_jsonl_export(tmp_path, assert 'linkedin-link' not in script.text -def test_harvestview_loads_pinned_tabulator_from_cdnjs(tmp_path, monkeypatch) -> None: +def test_harvestview_loads_pinned_tabulator_locally(tmp_path, monkeypatch) -> None: from theHarvester.lib.api import api monkeypatch.setenv('THEHARVESTER_API_KEY', 'test-key') @@ -93,20 +93,14 @@ def test_harvestview_loads_pinned_tabulator_from_cdnjs(tmp_path, monkeypatch) -> assert root.status_code == 200 assert 'bootstrap.min.css' not in root.text assert 'tabulator_bootstrap5.min.css' not in root.text - assert ( - '' - ) in root.text - assert ( - '' - ) in root.text + assert '' in root.text + assert '' in root.text + assert 'cdnjs.cloudflare.com' not in root.text assert 'https://unpkg.com' not in root.text - assert theme.status_code == 404 - assert script.status_code == 404 - assert license_file.status_code == 404 + assert theme.status_code == 200 + assert 'Tabulator v6.5.2' in script.text + assert license_file.status_code == 200 + assert 'The MIT License (MIT)' in license_file.text assert bootstrap.status_code == 404 assert old_theme.status_code == 404 diff --git a/theHarvester/lib/api/static/harvestview/TABULATOR-LICENSE b/theHarvester/lib/api/static/harvestview/TABULATOR-LICENSE new file mode 100644 index 00000000..3388c449 --- /dev/null +++ b/theHarvester/lib/api/static/harvestview/TABULATOR-LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2026 Oli Folkerd + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/theHarvester/lib/api/static/harvestview/index.html b/theHarvester/lib/api/static/harvestview/index.html index 559d9cb4..e3fef56f 100644 --- a/theHarvester/lib/api/static/harvestview/index.html +++ b/theHarvester/lib/api/static/harvestview/index.html @@ -6,7 +6,7 @@