comparison libervia/backend/plugins/plugin_comp_ap_gateway/http_server.py @ 4104:58bbc100f13b

component AP gateway: fix webfinger content type
author Goffi <goffi@goffi.org>
date Wed, 28 Jun 2023 14:24:42 +0200
parents 13b1079c27ec
children 7067b0d73183
comparison
equal deleted inserted replaced
4103:eaa0daa7f834 4104:58bbc100f13b
39 from libervia.backend.core.log import getLogger 39 from libervia.backend.core.log import getLogger
40 from libervia.backend.tools.common import date_utils, uri 40 from libervia.backend.tools.common import date_utils, uri
41 from libervia.backend.memory.sqla_mapping import SubscriptionState 41 from libervia.backend.memory.sqla_mapping import SubscriptionState
42 42
43 from .constants import ( 43 from .constants import (
44 NS_AP, MEDIA_TYPE_AP, CONTENT_TYPE_AP, TYPE_ACTOR, TYPE_INBOX, TYPE_SHARED_INBOX, 44 NS_AP, MEDIA_TYPE_AP, CONTENT_TYPE_WEBFINGER, CONTENT_TYPE_AP, TYPE_ACTOR, TYPE_INBOX,
45 TYPE_OUTBOX, TYPE_EVENT, AP_REQUEST_TYPES, PAGE_SIZE, ACTIVITY_TYPES_LOWER, 45 TYPE_SHARED_INBOX, TYPE_OUTBOX, TYPE_EVENT, AP_REQUEST_TYPES, PAGE_SIZE,
46 ACTIVIY_NO_ACCOUNT_ALLOWED, SIGN_HEADERS, HS2019, SIGN_EXP, TYPE_FOLLOWERS, 46 ACTIVITY_TYPES_LOWER, ACTIVIY_NO_ACCOUNT_ALLOWED, SIGN_HEADERS, HS2019, SIGN_EXP,
47 TYPE_FOLLOWING, TYPE_ITEM, TYPE_LIKE, TYPE_REACTION, ST_AP_CACHE 47 TYPE_FOLLOWERS, TYPE_FOLLOWING, TYPE_ITEM, TYPE_LIKE, TYPE_REACTION, ST_AP_CACHE
48 ) 48 )
49 from .regex import RE_SIG_PARAM 49 from .regex import RE_SIG_PARAM
50 50
51 51
52 log = getLogger(__name__) 52 log = getLogger(__name__)
118 "type": "application/activity+json", 118 "type": "application/activity+json",
119 "href": actor_url 119 "href": actor_url
120 } 120 }
121 ] 121 ]
122 } 122 }
123 request.setHeader("content-type", CONTENT_TYPE_AP) 123 request.setHeader("content-type", CONTENT_TYPE_WEBFINGER)
124 request.write(json.dumps(resp).encode()) 124 request.write(json.dumps(resp).encode())
125 request.finish() 125 request.finish()
126 126
127 async def handle_undo_activity( 127 async def handle_undo_activity(
128 self, 128 self,