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

Add Brotli support #878

Open
zachleat opened this issue Jun 28, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@zachleat
Copy link

commented Jun 28, 2019

image

Hey, I am loving Bridgy thanks for this service. Although recently I’ve noticed that I stopped receiving webmentions from the service a few weeks ago? Can you help me out? I use webmention.io.

This is the post it can’t find webmention support for:
https://www.zachleat.com/web/css-tricks-web-fonts/

I have the site linked up from my Twitter bio https://twitter.com/zachleat
image

I’ve tried recrawling my site using the Crawl now button and tried using Resend for post with the https://www.zachleat.com/web/css-tricks-web-fonts/ url.

AHA I found #829 which made a lot of sense to me. I did add brotli support recently and it would seem to coincide with this webmention regression.

However my Accept-Encoding headers seem to be working correctly.

image

What headers are you sending to opt-in to brotli encoding? My server only returns it if br is in Accept-Encoding. Are you using br;q=0 like @aaronpk suggested here? #829 (comment)

@snarfed

This comment has been minimized.

Copy link
Owner

commented Jun 28, 2019

hey, thanks for the kind words! and ugh, sorry for the trouble. this is due to an App Engine bug: it incorrectly adds br to Accept-Encoding in all outbound HTTP requests, regardless of the initial value.

the bug report has been open for almost a year, and acknowledged, but that's it. sigh. i'll nudge it again. i can also look into adding brotli support to bridgy...but in the meantime, your best bet is to disable brotli on your site. apologies again!

zachleat added a commit to zachleat/zachleat.com that referenced this issue Jun 29, 2019

@snarfed snarfed changed the title No webmention support (probably brotli related) Add Brotli support Jun 29, 2019

@snarfed

This comment has been minimized.

Copy link
Owner

commented Jun 30, 2019

a bit more background: requests supports brotli automatically when the brotli pip package is installed, but sadly that package uses a C native module, which App Engine Python 2.7 standard doesn't allow. i'm looking forward to upgrading Bridgy to the Python 3 standard runtime, which allows native modules, but they don't yet have a migration path from the existing APIs, which we'd need.

there is a pure python implementation of brotli, but its description, super slow pure python brotli decoder, please ignore, gives me pause, not that it might be slow, but that it sounds immature at best.

snarfed added a commit that referenced this issue Jul 1, 2019

@zachleat

This comment has been minimized.

Copy link
Author

commented Jul 1, 2019

If adding support for Brotli is a medium to larger scope item, maybe it would be worth investing in better error messaging for this issue first? No webmention support could be a bit more clear 😇

@snarfed

This comment has been minimized.

Copy link
Owner

commented Jul 1, 2019

sure! i've actually already added an explanation of this bug (and workaround) to the docs, and linked the error message to it.

brotli is still a very small subset of all the possible causes of this error - this is only the second instance i've seen so far - so if i added anything more to the UI itself, i'd lean toward the other more common causes first. hopefuly the link and mention in the docs are a good start though!

@zachleat

This comment has been minimized.

Copy link
Author

commented Jul 2, 2019

Awesome—that’s great to hear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.