News for hackers. Stuff that matters.
Re:Two years of Rust by eridius on Monday May 15, 2017 @05:24PM (#14345253)
I'm not saying you should support gzip. I'm saying you're sending Brotli-encoded data even when the browser doesn't support it, which results in the browser showing what looks like effectively random bytes. You need to respect the Accept-Encoding header.
Re:Two years of Rust by mmstick on Monday May 15, 2017 @05:32PM (#14345304)
That would require that I cache both a gzip and brotli variant of each page and content that is requested. I see no reason to support gzip just because a single company has refused to implement support for Brotli. Firefox, Chrome and Edge all support Brotli. Safari is the one man out. Apple needs more complaints about the lack of Brotli in Safari. Using Safari? Don't. You have Firefox and Chrome on all of your platforms.
Re:Two years of Rust by eridius on Monday May 15, 2017 @05:35PM (#14345323)
This is an incredibly user-hostile attitude.

Also, you don't seem to understand. I'm not telling you to support gzip. If the browser doesn't support Brotli, then just send back uncompressed content.

And it's not just Safari. All sorts of tools that support HTTP don't support Brotli. Case in point, I ran `curl` against your page and got garbage back.

Re:Two years of Rust by mmstick on Monday May 15, 2017 @05:45PM (#14345415)
It's not user-hostile at all. It is quite simple. I don't want to implement gzip support, and I definitely don't want uncompressed content. You can't demand me to implement what I don't want to implement for my website. You are not my target audience (gzip users, IE users, Safari users).

> And it's not just Safari. All sorts of tools that support HTTP don't support Brotli. Case in point, I ran `curl` against your page and got garbage back.

My website does not support HTTP. HTTP is basically a legacy protocol at this point. My website is HTTPS-exclusive. It does not listen on port 80. That Brotli doesn't work through HTTP is not surprising, given that HTTPS support is a base requirement for Brotli support.

Re:Two years of Rust by eridius on Monday May 15, 2017 @05:50PM (#14345452)
From your last paragraph I question whether you really understand anything you're being told here.

Yes, I said HTTP instead of HTTPS, but that wasn't meant to signify that I was using unsecured HTTP, since HTTPS is supported virtually everywhere and generally understood to be a part of HTTP. More specifically, if I actually try and access http://mmstick.tk, I just get redirected to https://mmstick.tk anyway, without having a content body, so it's not even possible to get Brotli-encoded data out of your server over HTTP. And if I run `curl https://mmstick.tk` then I get garbage, which was the whole point of that sentence and what you still haven't even addressed.

Also, how can HTTPS possibly be a requirement for Brotli? Brotli is a compression format, it doesn't care what the medium of transmission is, and it works just fine over HTTP. It just won't work with your site over HTTP because your site doesn't serve any content over HTTP.

Re:Two years of Rust by mmstick on Monday May 15, 2017 @06:10PM (#14345601)
I'm not sure where your confusion is. It doesn't matter that HTTPS is an encrypted form of HTTP. I do not support HTTP, which means that I do not support HTTP without encryption! End of story.

Attempting to access the site via HTTP will merely redirect you to the HTTPS service. Nothing is being hosted on the HTTP service. When you reach the HTTPS service, your browser will receive a HSTS header that will cause your web browser to automatically direct to the HTTPS server and not touch HTTP at all for future requests, ever. Nor can your connection be downgraded to HTTP.

> Also, how can HTTPS possibly be a requirement for Brotli? Brotli is a compression format, it doesn't care what the medium of transmission is, and it works just fine over HTTP. It just won't work with your site over HTTP because your site doesn't serve any content over HTTP.

Tell that to Google, Mozilla, and Microsoft. You cannot use Brotli compression over HTTP. Only when you are using the HTTPS protocol can you use Brotli. And in general, if you support HTTPS and are using an update browser, you more than likely already have support for Brotli today.

Re:Two years of Rust by eridius on Monday May 15, 2017 @06:28PM (#14345723)
Your use of HTTPS is completely irrelevant here, but I've already addressed that in the other thread (https://news.ycombinator.com/item?id=14345695).

> You cannot use Brotli compression over HTTP.

This is completely incorrect. Not only does Brotli have literally nothing to do with the transmission medium and whether it's encrypted, but just to be sure I just tested it and Chrome was perfectly happy to render a Brotli-encoded response over unsecured HTTP.

My best guess here is you've confused HTTP/2 (which requires SSL) with Brotli encoding.

Re:Two years of Rust by mmstick on Monday May 15, 2017 @07:04PM (#14345993)
> This is completely incorrect. Not only does Brotli have literally nothing to do with the transmission medium and whether it's encrypted, but just to be sure I just tested it and Chrome was perfectly happy to render a Brotli-encoded response over unsecured HTTP.

I highly doubt that you actually tried this in practice. You are merely assuming that it works. For Google to overturn their decision would fly against all reasoning for the decision in the first place.

> My best guess here is you've confused HTTP/2 (which requires SSL) with Brotli encoding.

You seem to not have any experience with Brotli support and why the decision was made to only support it over HTTPS. One such comment that outlies the reasoning is from a Google employee themselves ( https://bugs.chromium.org/p/chromium/issues/detail?id=452335... ).

Hence, all vendors have followed suit and are not implementing brotli for HTTP. SSL prevents all the middle man infrastructure in place from employing such tactics that would break websites serving content with the br content encoding. There still exists much infrastructure in place that snoops HTTP traffic and, when it is detected that the content encoding is an unknown format (brotli), it will compress the stream with gzip and change the content encoding to gzip, thus breaking the website.

In addition, yet again, Google engineers clearly state that Brotli support is only available over HTTPS connections!

https://groups.google.com/a/chromium.org/forum/#!msg/blink-d...

One of the big reasons for my decision in pursuing HTTPS support on my personal blog was so that I could, in fact, use Brotli. I already had the code in place, but enabling Brotli on my web server would merely give errors about the content encoding being unknown, and as you will notice, br is missing from the list of available accepted encodings by the browser! Yet it is there when connecting via HTTPS! That's because Brotli is completely and utterly disallowed over HTTP! Google engineers stated it themselves. You can't have it both ways.

Re:Two years of Rust by rhblake on Monday May 15, 2017 @11:37PM (#14347200)
So lemme try to clear this up.

You are right in that brotli decoding is only supposed to work in secure contexts (so technically not just HTTPS, btw -- localhost is also considered a secure context, see https://bugs.chromium.org/p/chromium/issues/detail?id=624426).

Eridius is right in that it currently does work over insecure HTTP in Chrome, as confirmed in this open bug: https://bugs.chromium.org/p/chromium/issues/detail?id=579606 -- in which one Chromium dev comments "Decoding brotli even if it isn't requested is both bug and feature. It allows developers to test brotli without setting up https serving." Seems like they concluded that it is indeed a bug, however.

Reality and specifications often diverge...

(I do think not supporting gzip is absolutely bizarre, but that's another issue.)

Re:Two years of Rust by eridius on Monday May 15, 2017 @07:40PM (#14346188)
> I highly doubt that you actually tried this in practice.

I told you explicitly that I tested it. Now you're calling me a liar. I am not "merely assuming that it works", I actually tested it to the point of controlling the exact bytes that the server sent to the client using a hand-constructed HTTP response and then pointing Chrome at that server.

> For Google to overturn their decision …

I just looked into the specific behavior here. Here's what I found:

* If you point Chrome at localhost, it includes "br" in the Accept-Encoding header.

* If you point Chrome at some other domain using HTTP, it does not include "br" in the Accept-Encoding header.

* Either way, if the server actually returns a Content-Encoding of "br", Chrome will respect it.

So basically, Chrome always supports Brotli-encoded responses. However, it only requests Brotli over HTTPS and doesn't request it over HTTP, and the only reason for this distinction is to avoid middleware servers from mucking with Brotli-encoded pages that they don't understand.

[dead]
Re:Two years of Rust by eridius on Monday May 15, 2017 @09:35PM (#14346749)
mmstick, what part of "I have actually tested this" do you not understand? I am not assuming anything. Please stop skimming my comments looking for things you can try to argue against and actually read the damn things.

> It states right there on both of the pages from Google that I linked to you. Brotli will not work without HTTPS.

Again, you don't understand what you're actually reading. There are two parts to Brotli support. The first is whether the browser will declare that it supports Brotli. This is the Accept-Encoding header. The second is whether the browser will actually correctly interpret a response encoded as Brotli. HTTPS only affects the first part. Chrome only declares to the server that it can accept Brotli when sending an HTTPS request and not when sending an HTTP request. But if the server ignores the Accept-Encoding header and hands back a Brotli response anyway (like your server is doing), Chrome will handle that exactly the same way over HTTP as it does over HTTPS. Because it's just a content encoding, and there is literally no reason to make the code that handles content encodings care about HTTP vs HTTPS.

> Enable HTTPS and pages decode. Switch to HTTP and they do not decode. End of story.

Please try testing this, because I promise you this is wrong. Switch to HTTP and if the server returns a Brotli-encoded response (with the Content-Encoding header set correctly) Chrome will still decode it. The only thing HTTPS controls is the contents of the Accept-Encoding header and not the actual behavior of the response decoder. I have tested this multiple times against Chrome 58.0.3029.110, using both localhost and a remote server. You clearly have not, and in light of this your final sentence is particularly ironic.

Re:Two years of Rust by sqeaky on Monday May 15, 2017 @06:40PM (#14345803)
What about serving uncompressed content over https?

What about serving up an error page when the user's browser odesn't have compressor you support?

What about paying attention to web standards?

What about people who are stuck with old software for one reason or another?

Re:Two years of Rust by mmstick on Monday May 15, 2017 @07:01PM (#14345959)
> What about serving uncompressed content over https?

I have limited bandwidth. I don't want to serve uncompressed content over HTTPS.

> What about serving up an error page when the user's browser odesn't have compressor you support?

I will do that once I figure out how to get the Request header from Rocket's API.

> What about paying attention to web standards?

I'm already complying with HTTPS web standards. I'm even pending for the HSTS preload list ( https://hstspreload.org/?domain=mmstick.tk ).

> What about people who are stuck with old software for one reason or another?

That's their problem, not mine. You shouldn't be using old web browsers and outdated systems on the web. That makes you vulnerable.

Re:Two years of Rust by sqeaky on Tuesday May 16, 2017 @11:22AM (#14350263)
> That's their problem, not mine. You shouldn't be using old web browsers and outdated systems on the web. That makes you vulnerable.

You wouldn't host a page if you didn't want to share its content, doesn't failing to do so make it atleast partially your problem?

You are ignoring the list of encodings the client gives you, you are paying attention to some and not all. If we all did the web wouldn't work.

Maybe they have good reasons, you aren't them and you don't know their situation. But you have chosen to not share with people with tech older than one year...

Step back, and try to take an objective look at this. Do you know what percentage of web browsers actually in use will work? Do you know what percentage of people visiting your page see only gibberish?

Finally, Why are so many of your comments in the gray and everyone else's not in the gray? Why do so many of your technical peers disagree with you?