---
id: 66e7353a-2898-4d28-822d-47c7aee9c862
title: public-origin postprocessor rewrites raw and release artifact HTML
state: closed
labels:
- kind:build
assignees: []
milestone: null
created: 2026-10-27T18:08:32.871053719Z
updated: 2026-10-27T18:20:51.798751533Z
---
## What

`absolutize_social_meta()` walks the whole output tree and rewrites every `.html` file:

`src/build.rs:1312-1334`:

- `path.extension() == "html"`
- `std::fs::read_to_string(&path)?`
- replace `content="/og.png"`

That includes committed raw HTML under `raw/` and copied release artifacts under `releases/<version>/`, not just generated pages.

## Reproduced

A repo with `raw/x.html` containing invalid UTF-8:

```
hu13 build . -o out --public-origin https://example.test
hu13: social meta read out/raw/raw/x.html: stream did not contain valid UTF-8
```

With valid raw HTML containing `content="/og.png"`, the copied bytes are silently rewritten to the absolute URL. Same for release artifact HTML.

## Impact

- A repo with a binary/invalid-UTF-8 `.html` raw file cannot build when `--public-origin` is set.
- `/raw/` and release artifact bytes no longer match the source (breaks byte-identical downloads, hashes, and user expectations).

## Fix

- Only postprocess generated page paths (or pass the absolute URL when rendering pages).
- Skip `raw/`, `repo.git/`, and `releases/<version>/` artifact trees.
- Regression test: raw `.html` invalid UTF-8 + raw HTML marker survives unchanged; generated page still gets absolute `og:image`.
