Skip to content

Commit b0258a7

Browse files
committed
Merge branch 'prevent-rendering-connections' into 'main'
Fix outbound connection established during PDF rendering See merge request reportcreator/reportcreator!1035
2 parents f64ecc1 + 56b39bb commit b0258a7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Upcoming
44
* Fix date field empty value not saved as null
5+
* Fix outbound connection established during PDF rendering
56
* Markdown editor: fix pasted images not inserted correctly in some cases
67
* Update executive summary section in HTB CBBH design
78

api/src/sysreptor/pentests/rendering/render_chromium.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ async def get_page():
2424
handle_sigint=False,
2525
handle_sigterm=False,
2626
handle_sighup=False,
27+
# Force offline mode by using a non-existent proxy to prevent network connections.
28+
# Chromium sometimes establishes a HTTPS connection during page.goto (but sends no requests because route overrides), even in offline mode.
29+
# With a proxy, all outgoing network connections use the non-existent proxy, which results in connection failures.
30+
proxy={'server': 'https://nonexistent.localhost'},
2731
)
2832
context = await browser.new_context(
2933
base_url=FAKE_BASE_URL,

0 commit comments

Comments
 (0)