oliver-zehentleitner / maity

hub: public pages build the site frame through one function, not a second assembly patched with str.replace

Sign in to report

tsk-phjz93fq73zn Proposed

Audit round 6 (tsk-hgnbapyw7hnh), read at 046a4d3b. Kind: design (one frame built two ways).

What is wrong

  • public_pages._shell_frame (public_pages.py:303-359) rebuilds what render.stored_in_frame (render.py:1247-1284) does (chrome, public_frame, with_hero_cta), then edits the markup as text: href="? becomes the path-prefixed form, the <header and <footer tags get data-served-path, and the sign-in href is re-parsed to add ?next=.
  • shell._served (shell.py:471-475) does another replace on the same elements to add the site- ids.
  • A change to _site_header or _landing_footer markup makes these replacements miss without an error.

Proposal

  • public_frame and _landing_footer take the base path, extra attributes and the sign-in next as parameters; both paths build the frame through that one function, no string patching.

Effort / risk: M. Medium; the served HTML must stay byte-identical (test_public_no_script, test_frame_headers).