{"action":"opened","issue":{"url":"https://api.github.com/repos/dtaniwaki/rack-dev-mark/issues/25","labels_url":"https://api.github.com/repos/dtaniwaki/rack-dev-mark/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/dtaniwaki/rack-dev-mark/issues/25/comments","events_url":"https://api.github.com/repos/dtaniwaki/rack-dev-mark/issues/25/events","html_url":"https://github.com/dtaniwaki/rack-dev-mark/issues/25","id":65793363,"number":25,"title":"Exclude dev-mark from redirects","user":{"login":"shedd","id":180497,"avatar_url":"https://avatars.githubusercontent.com/u/180497?v=3","gravatar_id":"","url":"https://api.github.com/users/shedd","html_url":"https://github.com/shedd","followers_url":"https://api.github.com/users/shedd/followers","following_url":"https://api.github.com/users/shedd/following{/other_user}","gists_url":"https://api.github.com/users/shedd/gists{/gist_id}","starred_url":"https://api.github.com/users/shedd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shedd/subscriptions","organizations_url":"https://api.github.com/users/shedd/orgs","repos_url":"https://api.github.com/users/shedd/repos","events_url":"https://api.github.com/users/shedd/events{/privacy}","received_events_url":"https://api.github.com/users/shedd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-01T22:33:35Z","updated_at":"2015-04-01T22:33:35Z","closed_at":null,"body":"On Rails, `redirect_to` sets the response body to:\r\n\r\n```\r\n<html><body>You are being <a href=\"http://url\">redirected</a>.</body></html>\r\n```\r\n\r\nalong with a redirect status.\r\n\r\nRails provides this as a response_body by default: https://github.com/rails/rails/blob/4ba1376c608cc797c80402a73568744b1c855f67/actionpack/lib/action_controller/metal/redirecting.rb#L76\r\n\r\n\r\nUsing rack-dev-mark, this gets expanded to the following:\r\n\r\n```\r\n<html><body><style>/* Left will inherit from right (so we don't need to duplicate code) */\r\n.github-fork-ribbon {\r\n  /* The right and left classes determine the side we attach our banner to */\r\n  position: absolute;\r\n\r\n  /* Add a bit of padding to give some substance outside the \"stitching\" */\r\n  padding: 2px 0;\r\n\r\n  /* Set the base colour */\r\n  background-color: #a00;\r\n\r\n  /* Set a gradient: transparent black at the top to almost-transparent black at the bottom */\r\n  background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.15)));\r\n  background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));\r\n  background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));\r\n  background-image: -ms-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));\r\n  background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));\r\n  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));\r\n\r\n  /* Add a drop shadow */\r\n  -webkit-box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5);\r\n  -moz-box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5);\r\n  box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5);\r\n\r\n  /* Set the font */\r\n  font: 700 13px \"Helvetica Neue\", Helvetica, Arial, sans-serif;\r\n\r\n  z-index: 9999;\r\n  pointer-events: auto;\r\n\r\n  opacity: 1;\r\n  transition: opacity .25s ease-in-out;\r\n  -moz-transition: opacity .25s ease-in-out;\r\n  -webkit-transition: opacity .25s ease-in-out;\r\n}\r\n\r\n.github-fork-ribbon:hover {\r\n  opacity: 0.2;\r\n}\r\n\r\n.github-fork-ribbon.red {\r\n  background-color: #a00;\r\n}\r\n\r\n.github-fork-ribbon.green {\r\n  background-color: #090;\r\n}\r\n\r\n.github-fork-ribbon.black {\r\n  background-color: #333;\r\n}\r\n\r\n.github-fork-ribbon.orange {\r\n  background-color: #f80;\r\n}\r\n\r\n.github-fork-ribbon .github-fork-ribbon-text,\r\n.github-fork-ribbon .github-fork-ribbon-text:hover {\r\n  /* Set the text properties */\r\n  color: #fff;\r\n  text-decoration: none;\r\n  text-shadow: 0 -1px rgba(0, 0, 0, 0.5);\r\n  text-align: center;\r\n  cursor: pointer;\r\n\r\n  /* Set the geometry. If you fiddle with these you'll also need\r\n     to tweak the top and right values in .github-fork-ribbon. */\r\n  width: 200px;\r\n  line-height: 20px;\r\n\r\n  /* Set the layout properties */\r\n  display: inline-block;\r\n  padding: 2px 0;\r\n\r\n  /* Add \"stitching\" effect */\r\n  border-width: 1px 0;\r\n  border-style: dotted;\r\n  border-color: #fff;\r\n  border-color: rgba(255, 255, 255, 0.7);\r\n}\r\n\r\n.github-fork-ribbon-wrapper {\r\n  width: 150px;\r\n  height: 150px;\r\n  position: absolute;\r\n  overflow: hidden;\r\n  top: 0;\r\n  z-index: 9999;\r\n  pointer-events: none;\r\n}\r\n\r\n.github-fork-ribbon-wrapper.fixed {\r\n  position: fixed;\r\n}\r\n\r\n.github-fork-ribbon-wrapper.left {\r\n  left: 0;\r\n}\r\n\r\n.github-fork-ribbon-wrapper.right {\r\n  right: 0;\r\n}\r\n\r\n.github-fork-ribbon-wrapper.left-bottom {\r\n  position: fixed;\r\n  top: inherit;\r\n  bottom: 0;\r\n  left: 0;\r\n}\r\n\r\n.github-fork-ribbon-wrapper.right-bottom {\r\n  position: fixed;\r\n  top: inherit;\r\n  bottom: 0;\r\n  right: 0;\r\n}\r\n\r\n.github-fork-ribbon-wrapper.right .github-fork-ribbon {\r\n  top: 42px;\r\n  right: -43px;\r\n\r\n  -webkit-transform: rotate(45deg);\r\n  -moz-transform: rotate(45deg);\r\n  -ms-transform: rotate(45deg);\r\n  -o-transform: rotate(45deg);\r\n  transform: rotate(45deg);\r\n}\r\n\r\n.github-fork-ribbon-wrapper.left .github-fork-ribbon {\r\n  top: 42px;\r\n  left: -43px;\r\n\r\n  -webkit-transform: rotate(-45deg);\r\n  -moz-transform: rotate(-45deg);\r\n  -ms-transform: rotate(-45deg);\r\n  -o-transform: rotate(-45deg);\r\n  transform: rotate(-45deg);\r\n}\r\n\r\n\r\n.github-fork-ribbon-wrapper.left-bottom .github-fork-ribbon {\r\n  top: 80px;\r\n  left: -43px;\r\n\r\n  -webkit-transform: rotate(45deg);\r\n  -moz-transform: rotate(45deg);\r\n  -ms-transform: rotate(45deg);\r\n  -o-transform: rotate(45deg);\r\n  transform: rotate(45deg);\r\n}\r\n\r\n.github-fork-ribbon-wrapper.right-bottom .github-fork-ribbon {\r\n  top: 80px;\r\n  right: -43px;\r\n\r\n  -webkit-transform: rotate(-45deg);\r\n  -moz-transform: rotate(-45deg);\r\n  -ms-transform: rotate(-45deg);\r\n  -o-transform: rotate(-45deg);\r\n  transform: rotate(-45deg);\r\n}\r\n</style>\r\n<!--[if lt IE 9]>\r\n<style>/* IE voodoo courtesy of http://stackoverflow.com/a/4617511/263871 and\r\n * http://www.useragentman.com/IETransformsTranslator */\r\n\r\n .github-fork-ribbon {\r\n  filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#000000', EndColorStr='#000000');\r\n}\r\n\r\n.github-fork-ribbon-wrapper.right .github-fork-ribbon {\r\n  /* IE positioning hack (couldn't find a transform-origin alternative for IE) */\r\n  top: -22px;\r\n  right: -62px;\r\n\r\n  /* IE8+ */\r\n  -ms-filter: \"progid:DXImageTransform.Microsoft.Matrix(M11=0.7071067811865474, M12=-0.7071067811865477, M21=0.7071067811865477, M22=0.7071067811865474, SizingMethod='auto expand')\";\r\n  /* IE6 and 7 */\r\n  filter: progid:DXImageTransform.Microsoft.Matrix(\r\n    M11=0.7071067811865474,\r\n    M12=-0.7071067811865477,\r\n    M21=0.7071067811865477,\r\n    M22=0.7071067811865474,\r\n    SizingMethod='auto expand'\r\n  );\r\n}\r\n\r\n.github-fork-ribbon-wrapper.left .github-fork-ribbon {\r\n  top: -22px;\r\n  left: -22px;\r\n\r\n  /* IE8+ */\r\n  -ms-filter: \"progid:DXImageTransform.Microsoft.Matrix(M11=0.7071067811865483, M12=0.7071067811865467, M21=-0.7071067811865467, M22=0.7071067811865483, SizingMethod='auto expand')\";\r\n  /* IE6 and 7 */\r\n  filter: progid:DXImageTransform.Microsoft.Matrix(\r\n    M11=0.7071067811865483,\r\n    M12=0.7071067811865467,\r\n    M21=-0.7071067811865467,\r\n    M22=0.7071067811865483,\r\n    SizingMethod='auto expand'\r\n  );\r\n}\r\n\r\n.github-fork-ribbon-wrapper.left-bottom .github-fork-ribbon {\r\n  /* IE positioning hack (couldn't find a transform-origin alternative for IE) */\r\n  top: 12px;\r\n  left: -22px;\r\n\r\n\r\n  /* IE8+ */\r\n  -ms-filter: \"progid:DXImageTransform.Microsoft.Matrix(M11=0.7071067811865474, M12=-0.7071067811865477, M21=0.7071067811865477, M22=0.7071067811865474, SizingMethod='auto expand')\";\r\n  /* IE6 and 7 */\r\n/*  filter: progid:DXImageTransform.Microsoft.Matrix(\r\n    M11=0.7071067811865474,\r\n    M12=-0.7071067811865477,\r\n    M21=0.7071067811865477,\r\n    M22=0.7071067811865474,\r\n    SizingMethod='auto expand'\r\n  );\r\n*/}\r\n\r\n.github-fork-ribbon-wrapper.right-bottom .github-fork-ribbon {\r\n  top: 12px;\r\n  right: -62px;\r\n\r\n  /* IE8+ */\r\n  -ms-filter: \"progid:DXImageTransform.Microsoft.Matrix(M11=0.7071067811865483, M12=0.7071067811865467, M21=-0.7071067811865467, M22=0.7071067811865483, SizingMethod='auto expand')\";\r\n  /* IE6 and 7 */\r\n  filter: progid:DXImageTransform.Microsoft.Matrix(\r\n    M11=0.7071067811865483,\r\n    M12=0.7071067811865467,\r\n    M21=-0.7071067811865467,\r\n    M22=0.7071067811865483,\r\n    SizingMethod='auto expand'\r\n  );\r\n}\r\n</style>\r\n<![endif]-->\r\n<div class=\"github-fork-ribbon-wrapper left\" onClick=\"this.style.display='none'\" title=\"\"><div class=\"github-fork-ribbon red\"><span class=\"github-fork-ribbon-text\">development</span></div></div>You are being <a href=\"http://url\">redirected</a>.</body></html>\r\n```\r\n\r\nThis takes the redirect body from ~80 B to about 7 KB.\r\n\r\nWithout having to explicitly use `skip_rack_dev_mark` everywhere, is it possible to exclude redirects from the dev-mark automatically?"}}