Browse Source

Detect RSS from the Content-Type of the HEAD response

The strpos arguments were reversed, so a HEAD response with an
application/rss+xml Content-Type was never reported as rss.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
main
Aaron Parecki 1 day ago
parent
commit
96abbb3c18
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/p3k/WebSub/Client.php

+ 1
- 1
src/p3k/WebSub/Client.php View File

@ -56,7 +56,7 @@ class Client {
if(strpos($content_type, 'text/html') !== false) { if(strpos($content_type, 'text/html') !== false) {
$type = $http['type'] = 'html'; $type = $http['type'] = 'html';
} else if(strpos($content_type, 'xml') !== false) { } else if(strpos($content_type, 'xml') !== false) {
if(strpos('rss', $content_type) !== false) {
if(strpos($content_type, 'rss') !== false) {
$type = $http['type'] = 'rss'; $type = $http['type'] = 'rss';
} else if(strpos($content_type, 'atom') !== false) { } else if(strpos($content_type, 'atom') !== false) {
$type = $http['type'] = 'atom'; $type = $http['type'] = 'atom';

Loading…
Cancel
Save