Go 1.27 HTTP Router with Generic Methods and Zero-Alloc Routing: FURSY — What an Independent Audit Found at 94% Coverage
Описание и применение
Проверка независимым аудитом выявила критические ошибки в CORS‑middleware и несоответствие документации реальному API FURSY. Исправление включило возврат только разрешённых заголовков и добавление негативного теста. Документация была очищена от неверных заявлений.
Задача
An independent audit revealed critical security and documentation issues in the FURSY HTTP router, despite high test coverage and internal fixes.
Результат
The audit uncovered a CORS header echo bug and documentation inaccuracies. Fixing the header logic and adding a negative test prevented potential security exposure. Documentation was cleaned to reflect real API capabilities.
Рабочий процесс
- 1. Identify CORS bug: server echoed raw request headers instead of filtered list.
- 2. Modify setPreflightHeaders to use allowedHeaders instead of reqHeaders.
- 3. Add TestCORS_PreflightFilteredHeaders to test negative case.
- 4. Review documentation for inconsistencies and remove non‑existent API references.
- 5. Update docs to match actual API surface.
Доказательства
The server should respond with only the headers it actually allows.
headers.Set("Access-Control-Allow-Headers", reqHeaders) // BUG
headers.Set("Access-Control-Allow-Headers", allowedHeaders) // FIXED
The documentation was lying: router.Run(":8080") – method doesn’t exist
- Дата записи: 2026-10-08T01:40:48.334Z