You've already forked hotpocket
BTHLABS-65: Implement support for Win 11 payload in PWA share sheet endpoint
Co-authored-by: Tomek Wójcik <labs@tomekwojcik.pl> Co-committed-by: Tomek Wójcik <labs@tomekwojcik.pl>
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
from . import android # noqa: F401
|
||||
from . import extension # noqa: F401
|
||||
from . import ios # noqa: F401
|
||||
from . import pwa # noqa: F401
|
||||
|
||||
@@ -21,10 +21,14 @@ def share_sheet(request: HttpRequest) -> HttpResponse:
|
||||
|
||||
try:
|
||||
assert request.user.is_anonymous is False, 'Login required'
|
||||
assert 'text' in request.POST, 'Bad request: Missing `text`'
|
||||
|
||||
url = request.POST['text'].split('\n')[0].strip()
|
||||
assert url != '', 'Bad request: Empty `text`'
|
||||
url: str = ''
|
||||
if 'url' in request.POST:
|
||||
url = request.POST['url'].strip()
|
||||
elif 'text' in request.POST:
|
||||
url = request.POST['text'].split('\n')[0].strip()
|
||||
|
||||
assert url != '', 'Bad request: Empty `url`'
|
||||
|
||||
return CreateSaveWorkflow().run(
|
||||
request=request,
|
||||
@@ -50,7 +50,7 @@ def manifest_json(request: HttpRequest) -> JsonResponse:
|
||||
'scope': '/',
|
||||
'share_target': {
|
||||
'action': request.build_absolute_uri(
|
||||
reverse('ui.integrations.android.share_sheet'),
|
||||
reverse('ui.integrations.pwa.share_sheet'),
|
||||
),
|
||||
'method': 'POST',
|
||||
'enctype': 'multipart/form-data',
|
||||
|
||||
Reference in New Issue
Block a user