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

FormatException (FormatException: Unexpected extension byte (at offset 9504)) for certain valid urls #11

Closed
mlars84 opened this issue Jun 22, 2021 · 2 comments
Assignees

Comments

@mlars84
Copy link
Contributor

mlars84 commented Jun 22, 2021

I keep hitting this FormatException from convert_patch.dart when https://www.google.com/ is the passed as the link. Code example:

AnyLinkPreview(
  link: "https://www.google.com",
  cache: Duration(hours: 1),
  backgroundColor: Colors.grey[300],
  errorWidget: Container(
    color: Colors.grey[300],
    child: Text('Oops!'),
  ),
);

https://www.google.com/ is an unlikely use case and not particularly concerning, but it is concerning that AnyLinkPreview is getting stuck in a loading state rather than handling this more gracefully. I am on Flutter 2.2.2 and using any_link_preview ^2.0.0-rc.

If I run the example from the repo I am also getting Web page resolution failure from:https://www.google.com Error:FormatException: Bad GBK encoding 0xd00c. I'm assuming this is due to how the document body is being parsed and google being an outlier, but is there concern that this could be a common issue with url's?

mlars84 referenced this issue Jun 22, 2021
To support more platforms

Signed-off-by: Pranav Bedre <bedrepranav@gmail.com>
@ghpranav
Copy link
Contributor

@sur950 Removing br from accept-encoding list of headers seems to fix this issue

..headers["accept-encoding"] = "gzip, deflate, br"

@mlars84 mlars84 closed this as completed Jun 29, 2021
@mlars84 mlars84 reopened this Jun 29, 2021
@sur950
Copy link
Owner

sur950 commented Jun 30, 2021

Hi @mlars84 Thanks for reporting the bug.

@ghpranav Could you raise a PR for the same, I will merge that instantly, Working on own product & not finding enough time for the support.

Cheers,
Suresh

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

No branches or pull requests

3 participants