Misskey: Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"

Created on 30 Sep 2019  ·  4Comments  ·  Source: syuilo/misskey

https://www.w3.org/TR/activitypub/

MUST present the ActivityStreams object representation in response to application/ld+json; profile="https://www.w3.org/ns/activitystreams"

misskey does not do this (but it MUST)

and SHOULD also present the ActivityStreams representation in response to application/activity+json as well.

misskey only does this (which it SHOULD)

⚠️bug?

All 4 comments

Related to #1734 and #2385
CC: @mei23

it looks like it does

i was able to get correct response by requesting application/ld+json alone, but once you add profile="https://www.w3.org/ns/activitystreams" it returns html instead

[trwnh@desktop ~]$ curl -i -H 'Accept: application/ld+json' https://blackmesa.space/notes/7y97p0obws
HTTP/2 200 
server: nginx/1.14.0 (Ubuntu)
date: Mon, 30 Sep 2019 09:55:24 GMT
content-type: application/ld+json; profile="https://www.w3.org/ns/activitystreams"; charset=utf-8
content-length: 917
vary: Accept-Encoding, Accept
strict-transport-security: max-age=15552000; preload
cache-control: public, max-age=180

{"@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1",{"Hashtag":"as:Hashtag"}],"id":"https://blackmesa.space/notes/7y97p0obws","type":"Note","attributedTo":"https://blackmesa.space/users/7vhrd3ea6h","summary":null,"content":"<p><span>tbh i have no idea how any of that works either...though i know misskey works with activitypub so i dont understand why pixelfed doesnt work </span>😕</p>","_misskey_content":"tbh i have no idea how any of that works either...though i know misskey works with activitypub so i dont understand why pixelfed doesnt work 😕","published":"2019-09-30T00:01:08.267Z","to":["https://www.w3.org/ns/activitystreams#Public"],"cc":["https://blackmesa.space/users/7vhrd3ea6h/followers"],"inReplyTo":"https://blackmesa.space/notes/7y8ng16syp","attachment":[],"sensitive":false,"tag":[{"type":"Mention","href":"https://blackmesa.space/@finger","name":"@finger"}]}
[trwnh@desktop ~]$ curl -i -H 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"' https://blackmesa.space/notes/7y97p0obws
HTTP/2 200 
server: nginx/1.14.0 (Ubuntu)
date: Mon, 30 Sep 2019 09:56:32 GMT
content-type: text/html; charset=utf-8
content-length: 5863
vary: Accept-Encoding
vary: Accept-Encoding, Accept
strict-transport-security: max-age=15552000; preload
x-frame-options: DENY
cache-control: public, max-age=180

<!DOCTYPE html>
<!-- Thank you for using Misskey! @syuilo -->
<html><head><meta charset="utf-8"><meta name="application-name" content="Misskey"><meta name="referrer" content="origin"><meta name="theme-color" content="#105779"><meta property="og:site_name" content="The Black Mesa"><link rel="icon" href="/favicon.ico"><link rel="manifest" href="/manifest.json"><title>¿desvox? (@alayna) | The Black Mesa</title><meta name="description" content="tbh i have no idea how any of that works either...though i know misskey works with activitypub so i dont understand why pixelfed doesnt work 😕

RE: Interesting. On Misskey the public timeline show not only public posts but also public replies to toots and people's reboost, but not from all people, only a few and I absolutely don't know how Misskey handle that.

That's cool but, Misskey is still not compatible with some others activitypub websites like Pixelfed, and that's a shame :c"><meta name="misskey:user-username" content="alayna"><meta name="misskey:user-id" content="7vhrd3ea6h"><meta name="misskey:note-id" content="7y97p0obws"><meta name="twitter:card" content="summary"><!-- todo--><link rel="alternate" href="https://blackmesa.space/notes/7y97p0obws" type="application/activity+json"><meta property="og:type" content="article"><meta property="og:title" content="¿desvox? (@alayna)"><meta property="og:description" content="tbh i have no idea how any of that works either...though i know misskey works with activitypub so i dont understand why pixelfed doesnt work 😕

RE: Interesting. On Misskey the public timeline show not only public posts but also public replies to toots and people's reboost, but not from all people, only a few and I absolutely don't know how Misskey handle that.

That's cool but, Misskey is still not compatible with some others activitypub websites like Pixelfed, and that's a shame :c"><meta property="og:url" content="https://blackmesa.space/notes/7y97p0obws"><meta property="og:image" content="https://blackmesa.space/files/thumbnail-44beea05-43a8-43b9-9248-dee7a1656395"><style>html{font-family:Roboto,HelveticaNeue,Arial,sans-serif}body>noscript{position:fixed;z-index:2;top:0;left:0;width:100%;height:100%;text-align:center;background:#fff}body>noscript>p{display:block;margin:32px;font-size:2em;color:#555}#ini{position:fixed;z-index:1;top:0;left:0;width:100%;height:100%;background:var(--bg);cursor:wait}#ini>svg{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;width:64px;height:64px;animation:a .6s infinite linear}@keyframes a{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}</style><script>"use strict";!async function(){if("true"==localStorage.getItem("shouldFlush"))return void h();const e=["cs-CZ","da-DK","de-DE","en-US","es-ES","fr-FR","ja-JP","ja-KS","ko-KR","nl-NL","pl-PL","zh-CN","zh-TW"],t=localStorage.getItem("theme");if(t)for(const[e,a]of Object.entries(JSON.parse(t)))document.documentElement.style.setProperty(`--${e}`,a.toString());let a=null;const o=localStorage.getItem("vuex");o&&(a=JSON.parse(o));const l=new URL(location.href);let n=null;`${l.pathname}/`.startsWith("/docs/")&&(n="docs"),`${l.pathname}/`.startsWith("/dev/")&&(n="dev"),`${l.pathname}/`.startsWith("/auth/")&&(n="auth"),`${l.pathname}/`.startsWith("/admin/")&&(n="admin");const s=localStorage.getItem("v")||"11.26.0";let i=null;e.includes(navigator.language)?i=navigator.language:null==(i=e.find(e=>e.split("-")[0]==navigator.language))&&(i="en-US"),a&&a.device.lang&&e.includes(a.device.lang)&&(i=a.device.lang),localStorage.setItem("lang",i);const r=localStorage.getItem("locale"),c=localStorage.getItem("localeKey");if(null==r||c!=`${s}.${i}`){const e=await fetch(`/assets/locales/${i}.json?ver=${s}`).then(e=>e.json());localStorage.setItem("locale",JSON.stringify(e)),localStorage.setItem("localeKey",`${s}.${i}`)}const d=navigator.userAgent.toLowerCase();let m=/mobile|iphone|ipad|android/.test(d)||window.innerWidth<576;a&&a.device.appTypeForce&&("mobile"===a.device.appTypeForce?m=!0:"desktop"===a.device.appTypeForce&&(m=!1));const g=document.getElementsByTagName("head")[0];if(m){const e=document.createElement("meta");e.setAttribute("name","viewport"),e.setAttribute("content","width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"),g.appendChild(e)}null==n&&(n=m?"mobile":"desktop");const u=document.createElement("script");function h(){localStorage.setItem("shouldFlush","false"),localStorage.removeItem("locale");try{navigator.serviceWorker.controller.postMessage("clear"),navigator.serviceWorker.getRegistrations().then(e=>{for(const t of e)t.unregister()})}catch(e){console.error(e)}location.reload(!0)}u.setAttribute("src",`/assets/${n}.${s}.js`),u.setAttribute("async","true"),u.setAttribute("defer","true"),g.appendChild(u),window.mkBootTimer=window.setTimeout(async()=>{const e=await fetch("/api/meta",{method:"POST",cache:"no-cache"}),t=await e.json();t.version!=s&&(localStorage.setItem("v",t.version),alert("Misskeyの新しいバージョンがあります。ページを再度読み込みします。\n\nNew version of Misskey available. The page will be reloaded."),h())},3e3)}();</script><script>"fetch"in window||alert("お使いのブラウザ(またはOS)のバージョンが旧式のため、Misskeyを動作させることができません。バージョンを最新のものに更新するか、別のブラウザをお試しください。\n\nYour browser (or your OS) seems outdated. To run Misskey, please update your browser to latest version or try other browsers.");</script></head><body><noscript><p>JavaScriptを有効にしてください<br>Please turn on your JavaScript</p></noscript><div id="ini"><svg viewBox="0 0 50 50">
    <path fill=#fb4e4e d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" />

https://github.com/syuilo/misskey/blob/84be4aa91e66e798f8dca5c229c2895a2e47a647/src/server/activitypub.ts#L51
もおかしいけど、ここだけがおかしくてもContent-Typeがjsonになるだけなので

Content-Typeがhtmlで内容もhtmlになってしまうのはこっちが原因
https://github.com/syuilo/misskey/blob/84be4aa91e66e798f8dca5c229c2895a2e47a647/src/server/activitypub.ts#L46

Was this page helpful?
0 / 5 - 0 ratings