fediverse-devnet / feditest

A testing framework for distributed, heterogeneous systems communicating with complex protocols, such as the Fediverse
https://feditest.org/
MIT License
26 stars 4 forks source link

Data URIs not accepted #197

Closed mexon closed 1 day ago

mexon commented 2 weeks ago

Data URIs are treated as invalid URIs and cause a test failure, even though they are valid. These are used in Friendica. Example:

curl -s -A "Mozilla" "https://friendica.exon.name/.well-known/webfinger?resource=acct:mat@friendica.exon.name" | jq '.links[] | select(.rel=="magic-public-key")'
{
  "rel": "magic-public-key",
  "href": "data:application/magic-public-key,RSA.pwsSS0yM-NaeZto4hVwNVVc8EdPHJSojco9U91lQdn0FsjrIUwEtegb8feo2Hozl3G8GmtAH5pLCsEhOHEn7Aw.AQAB"
}
feditest.AssertionFailure: WebFinger errors (3)
Accessed URI: "https://friends.holograms.test/.well-known/webfinger?resource=acct%3Ajem%40friends.holograms.test&rel=http%3A//webfinger.net/rel/profile-page&rel=something-else&rel=self".
0: Link rel value not absolute URI nor registered relation type: "salmon"
1: Link rel value not absolute URI nor registered relation type: "magic-public-key"
2: Link href not a URI: "data:application/magic-public-key,RSA.6UazJKhugKx0DKlZSYCnC60C0L2uNHJNt7zdtsZ6pT8usPsfiI9WP7RUBFF535zcdWkSMzpKYu8pts2pTDK2Pw.AQAB"
Expected: None
     but: was <WebFinger errors (3 sub-exceptions)>

The first two errors are valid, but the third should not be considered an error.

jernst commented 2 weeks ago

Good catch!