Created
May 28, 2013 15:29
-
-
Save Antaris/5663603 to your computer and use it in GitHub Desktop.
Older Android devices seem to struggle with Cassette's release urls (/cassette.axd/styleseet/*, etc) because of the presence of an underscore. The following re-write rules will rewrite the outbound html to change the urls to something Android 2.* devices will like, and an inbound rewrite to match incoming requests to the CassetteHttpHandler. Thi…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<rewrite> | |
<outboundRules> | |
<rule name="CassetteOutboundUrl" preCondition="HtmlContent" stopProcessing="false"> | |
<match filterByTags="Link, Script" pattern="^/cassette.axd/(.*?)/(.*)" /> | |
<action type="Rewrite" value="/cassette.axd/?type={R:1}&data={R:2}" /> | |
</rule> | |
<preConditions> | |
<remove name="HtmlContent" /> | |
<preCondition name="HtmlContent"> | |
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> | |
<add input="{USER_AGENT}" pattern="android 2.*?;" /> | |
</preCondition> | |
</preConditions> | |
</outboundRules> | |
<rules> | |
<rule name="CassetteIncomingUrl"> | |
<match url="^cassette.axd/" /> | |
<action type="Rewrite" url="/cassette.axd/{C:1}/{C:2}" appendQueryString="false" /> | |
<conditions trackAllCaptures="true"> | |
<add input="{QUERY_STRING}" pattern="type=(.*?)&data=(.*)" /> | |
<add input="{USER_AGENT}" pattern="android 2.*?;" /> | |
</conditions> | |
<serverVariables> | |
<set name="HTTP_ACCEPT_ENCODING" value="" /> | |
</serverVariables> | |
</rule> | |
</rules> | |
</rewrite> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment