GET /rss
/rssReturns a well-formed RSS 2.0 feed: channel title present, pubDate in RFC 822 format, guid is a valid permalink URL, no enclosure type lies. Counterpart to /rss, which ships one of four violations.
expect: 200 OK with Content-Type: application/rss+xml. Body is a valid RSS 2.0 document with all required elements.
curl -si 'https://not.catastrophic.io/rss' | grep -E '^(HTTP|content-type|x-chaos-rss)'
# Default mode (missing-channel-title) drops from .
# RSS 2.0 §2.3.1 lists it as required. Aggregators using channel.title
# for the feed display name render "undefined" or throw.
import urllib.request
from xml.etree import ElementTree as ET
resp = urllib.request.urlopen("https://not.catastrophic.io/rss")
print("Content-Type:", resp.headers.get("Content-Type"))
print("X-Chaos-Rss-Mode:", resp.headers.get("X-Chaos-Rss-Mode"))
root = ET.fromstring(resp.read())
channel = root.find("channel")
print("channel found:", channel is not None)
if channel is not None:
title = channel.find("title")
print("channel title present:", title is not None)
print("channel children:", [c.tag for c in channel])
const res = await fetch("https://not.catastrophic.io/rss");
console.log("Mode:", res.headers.get("X-Chaos-Rss-Mode"));
const raw = await res.text();
const doc = new DOMParser().parseFromString(raw, "application/xml");
const channel = doc.querySelector("channel");
console.log("channel found:", !!channel);
console.log("channel title present:", !!channel?.querySelector("title"));
package main
import (
"encoding/xml"
"fmt"
"io"
"net/http"
)
type Rss struct {
Channel struct {
Title string `xml:"title"`
Items []struct {
Title string `xml:"title"`
} `xml:"item"`
} `xml:"channel"`
}
func main() {
resp, _ := http.Get("https://not.catastrophic.io/rss")
defer resp.Body.Close()
raw, _ := io.ReadAll(resp.Body)
fmt.Println("Mode:", resp.Header.Get("X-Chaos-Rss-Mode"))
var feed Rss
xml.Unmarshal(raw, &feed)
fmt.Println("channel title:", feed.Channel.Title)
fmt.Println("channel title empty:", feed.Channel.Title == "")
fmt.Println("items:", len(feed.Channel.Items))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["blocking"] }
fn main() -> Result<(), Box> {
let resp = reqwest::blocking::get("https://not.catastrophic.io/rss")?;
println!("Mode: {:?}", resp.headers().get("x-chaos-rss-mode"));
let body = resp.text()?;
// Quick check: does contain a ?
let channel_start = body.find("").unwrap_or(0);
let channel_block = &body[channel_start..body.find(" ").unwrap_or(body.len())];
println!("channel has : {}", channel_block.contains(""));
Ok(())
}
import java.net.URI;
import java.net.http.*;
public class RssChaos {
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var req = HttpRequest.newBuilder(URI.create("https://not.catastrophic.io/rss")).build();
var resp = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("Content-Type: " + resp.headers().firstValue("Content-Type").orElse(""));
System.out.println("X-Chaos-Rss-Mode: " + resp.headers().firstValue("X-Chaos-Rss-Mode").orElse(""));
System.out.println("Body: " + resp.body());
}
}
using var client = new HttpClient();
var resp = await client.GetAsync("https://not.catastrophic.io/rss");
Console.WriteLine($"Content-Type: {resp.Content.Headers.ContentType}");
Console.WriteLine($"X-Chaos-Rss-Mode: {resp.Headers.GetValues("X-Chaos-Rss-Mode").FirstOrDefault()}");
var body = await resp.Content.ReadAsStringAsync();
Console.WriteLine($"Body: {body}");
require "net/http"
require "rexml/document"
uri = URI("https://not.catastrophic.io/rss")
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
res = http.get(uri.request_uri)
puts "Content-Type: #{res['Content-Type']}"
puts "X-Chaos-Rss-Mode: #{res['X-Chaos-Rss-Mode']}"
doc = REXML::Document.new(res.body)
channel = doc.elements["rss/channel"]
puts "channel found: #{!channel.nil?}"
puts "channel title present: #{!channel.elements["title"].nil?}" if channel
end
$r = Invoke-WebRequest -Uri 'https://not.catastrophic.io/rss'
"Content-Type: $($r.Headers['Content-Type'])"
"X-Chaos-Rss-Mode: $($r.Headers['X-Chaos-Rss-Mode'])"
$xml = [xml]$r.Content
$channel = $xml.rss.channel
"channel found: $($null -ne $channel)"
"channel title present: $($null -ne $channel.title)"
headers
body