It doesn't care if it's a binary stream or not - it was rewriting anything which passed through it in plaintext. By extending the URL which has to be matched, the number of collisions (changes) decreases drastically. Unfortunately, that's probably coming at something of a cost to the system processor - maybe not an issue now, but will be eventually. As well and as stated above (in my much mangled first post), any files which actually contain plaintext links to the site are still going to be rewritten (and this will happen as your actual servers on the backend are built around HTML documents), meaning that the appropriate solution is still to use content-type as causation for allowing the rewrite.