Browser suite: ipxd list, a feed that moves for good, Atom with a bare ampersand (#463)
API coverage 78.0% to 80.0% (9174 of 11467 lines): follow_move and the catalogue's list, and the parser's retry of an escaped Atom feed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -89,7 +89,7 @@ http.createServer((req, res) => {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
// Feeds in the shapes the others are not (#463): Atom; RSS with a bare "&" and the iTunes and
|
||||
// Feeds in the shapes the others are not (#463): Atom and RSS each with a bare "&", the RSS with the iTunes and
|
||||
// Media RSS fields; WordPress.com's posts as its API sends them; and replies that are no feed.
|
||||
const at = `http://127.0.0.1:${port}`;
|
||||
const shapes: Record<string, [string, string]> = {
|
||||
@@ -97,7 +97,7 @@ http.createServer((req, res) => {
|
||||
<feed xmlns="http://www.w3.org/2005/Atom"><title type="html">Atom&#8217;s Show</title>
|
||||
<subtitle>An Atom feed</subtitle><link rel="alternate" href="${at}/atom.html"/><logo>${at}/art.jpg</logo>
|
||||
<id>urn:atom-show</id><updated>2026-01-01T00:00:00Z</updated>
|
||||
<entry><id>urn:atom-1</id><title>Q&A in Atom</title><updated>2026-01-02T00:00:00Z</updated>
|
||||
<entry><id>urn:atom-1</id><title>Q&A in Atom</title><updated>2026-01-02T00:00:00Z</updated>
|
||||
<published>2026-01-02T00:00:00Z</published><link rel="alternate" href="${at}/atom-1.html"/>
|
||||
<link rel="enclosure" href="${at}/atom-1.mp3" type="audio/mpeg" length="40000"/>
|
||||
<link rel="enclosure" href="${at}/atom-1.mp3?_=1" type="audio/mpeg" length="40000"/>
|
||||
@@ -121,6 +121,9 @@ http.createServer((req, res) => {
|
||||
guid: { rendered: `${at}/?p=1` }, link: `${at}/wp-1`, title: { rendered: 'WordPress “post”' },
|
||||
date_gmt: '2026-01-04T12:00:00', content: { rendered: '<p>Post body</p>' }, jetpack_featured_media_url: `${at}/art.jpg`,
|
||||
}])],
|
||||
// Where /flip.xml moves to for good.
|
||||
'/moved.xml': ['application/rss+xml', `<?xml version="1.0"?><rss version="2.0"><channel><title>Flip Show</title>
|
||||
<item><guid>flip-1</guid><title>Flip one</title></item></channel></rss>`],
|
||||
'/said.txt': ['text/plain', 'Unable to establish a DB connection'],
|
||||
'/long.txt': ['text/plain', 'This site is down for maintenance and will be back shortly, thank you for your patience while we work'],
|
||||
'/empty.xml': ['application/xml', ''],
|
||||
@@ -132,6 +135,7 @@ http.createServer((req, res) => {
|
||||
if (req.url?.startsWith('/flip?to=')) { flip = req.url.slice('/flip?to='.length); res.writeHead(204).end(); return; }
|
||||
if (req.url === '/flip.xml') {
|
||||
if (/^\d{3}$/.test(flip)) { res.writeHead(Number(flip)).end('no'); return; }
|
||||
if (flip === 'moved') { res.writeHead(301, { location: '/moved.xml' }).end(); return; }
|
||||
if (flip === 'loop') { res.writeHead(302, { location: '/flip.xml' }).end(); return; }
|
||||
if (flip === 'drop') { req.socket.destroy(); return; }
|
||||
const body = flip === 'text' ? 'Unable to establish a DB connection'
|
||||
|
||||
Reference in New Issue
Block a user