Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error #2147 Forbidden protocol in URL trying to print on iOS with Mobile Print Util #2988

Open
rdefalco opened this issue Dec 28, 2023 · 1 comment
Labels

Comments

@rdefalco
Copy link

rdefalco commented Dec 28, 2023

Hello,
we are trying to call an URL to invoke the app "Mobile Print Util" for iOS whose protocols are listed as examples here
https://www.mobileprintutil.com/linktest.htm

with AIR 50, any current version, we try to call the method
navigateToURL(new URLRequest(url));

where url is something like
com.samathosoft.webprint://#deb64#[base64]
and [base64] is replaced with an actual text encoded in Base64 format, but we get the error #2147 Forbidden protocol in URL

Opening the links from Safari actually opens the print app.

Searching online didn't lead me to useful resources, I've found there is a info.plist addition called "UISupportedExternalAccessoryProtocols" but I can't find a correlation with AIR.

EDIT: re-reading the documentation at
https://help.adobe.com/en_US/air/reference/html/flash/net/URLRequest.html#url
I've also tried to substitute the # symbol with %23
com.samathosoft.webprint://%23deb64%23[base64]
but it did NOT work

EDIT2: I've also tried to include UISupportedExternalAccessoryProtocols but didn't have any effect
apparently it's the dots in the protocol section of the URL that causes the issue, if I try the same url without the dots
comsamathosoftwebprint://#deb64#[base64]
obviously the target app does NOT open, but neither I get the forbidden protocol error.

@rdefalco rdefalco added the Bug label Dec 28, 2023
@ajwfrost
Copy link
Collaborator

ajwfrost commented Jan 8, 2024

Yes it looks like there's code in there to check the scheme isn't something dodgy, but it's not then conforming to the spec... from RFC3986:

Scheme names consist of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus ("+"), period ("."), or hyphen ("-").

Whereas the code is going through to ensure the scheme is all alpha/numeric and only allowing a hyphen as a special character.

So this is something that needs an update in the runtime, albeit a very easy one...

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants