Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
ywwenjin163
pushed a commit
to ywwenjin163/open-seo
that referenced
this pull request
Sep 12, 2026
crawlPage sends `Accept: text/html,application/xhtml+xml` but classified a document as HTML only when its content-type contained the exact lowercase substring `text/html`. A page served as application/xhtml+xml or TEXT/HTML was stored as a non-HTML asset: no title, no meta description, no headings, no links, so the crawl also never left the start URL.
kevin9327
force-pushed
the
fix/audit-xhtml-content-type
branch
from
September 13, 2026 13:08
b954f82 to
90baa78
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
crawlPageasks for two document types and accepts one:application/xhtml+xmlnever containstext/html, and the substring test iscase-sensitive, so
Content-Type: TEXT/HTMLfails it too — media types arecase-insensitive per RFC 9110.
isHtml === falseis not a small mislabel. The body is never handed toanalyzeHtml, so the row is persisted with an empty title, empty metadescription, no headings, no images, no structured data and no links, and
runPageReportersreturns early on!page.isHtml— the page reports noissues at all. Because no links are extracted, nothing is added to the
frontier either: on a site that serves XHTML the audit stops at the start URL.
Fix
Lowercase the header and accept the second type the request already asked for.
Tests
New
site-audit-workflow-helpers.test.ts, stubbingfetchthe wayscrape.test.tsdoes. Three content types that must be analyzed, and one thatmust not —
application/pdfis the pin that this is not a widening; it passesbefore and after.
Against
main:With the fix:
How I tested
Windows 11, Node 22.
I did not run the whole suite or e2e.
Scope
Only the two types the crawler advertises. I did not add
application/xmlortext/xml: those are not requested, and a sitemap or feed answering anAccept: text/htmlrequest is not a page the analyzer should read.