{"action":"created","issue":{"url":"https://api.github.com/repos/warren-bank/moz-rewrite/issues/4","labels_url":"https://api.github.com/repos/warren-bank/moz-rewrite/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/warren-bank/moz-rewrite/issues/4/comments","events_url":"https://api.github.com/repos/warren-bank/moz-rewrite/issues/4/events","html_url":"https://github.com/warren-bank/moz-rewrite/issues/4","id":99972671,"number":4,"title":"window.location.origin is not supported","user":{"login":"vsemozhetbyt","id":10393198,"avatar_url":"https://avatars.githubusercontent.com/u/10393198?v=3","gravatar_id":"","url":"https://api.github.com/users/vsemozhetbyt","html_url":"https://github.com/vsemozhetbyt","followers_url":"https://api.github.com/users/vsemozhetbyt/followers","following_url":"https://api.github.com/users/vsemozhetbyt/following{/other_user}","gists_url":"https://api.github.com/users/vsemozhetbyt/gists{/gist_id}","starred_url":"https://api.github.com/users/vsemozhetbyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsemozhetbyt/subscriptions","organizations_url":"https://api.github.com/users/vsemozhetbyt/orgs","repos_url":"https://api.github.com/users/vsemozhetbyt/repos","events_url":"https://api.github.com/users/vsemozhetbyt/events{/privacy}","received_events_url":"https://api.github.com/users/vsemozhetbyt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-10T05:08:02Z","updated_at":"2015-08-10T20:54:01Z","closed_at":null,"body":"Could you please add the .origin property to request.window_location ?\r\n\r\nhttps://developer.mozilla.org/en-US/docs/Web/API/Location\r\n\r\nhttps://developer.mozilla.org/en-US/docs/Web/API/URLUtils/origin\r\n\r\nIt would be very useful for CORS headers modification."},"comment":{"url":"https://api.github.com/repos/warren-bank/moz-rewrite/issues/comments/129603290","html_url":"https://github.com/warren-bank/moz-rewrite/issues/4#issuecomment-129603290","issue_url":"https://api.github.com/repos/warren-bank/moz-rewrite/issues/4","id":129603290,"user":{"login":"warren-bank","id":6810270,"avatar_url":"https://avatars.githubusercontent.com/u/6810270?v=3","gravatar_id":"","url":"https://api.github.com/users/warren-bank","html_url":"https://github.com/warren-bank","followers_url":"https://api.github.com/users/warren-bank/followers","following_url":"https://api.github.com/users/warren-bank/following{/other_user}","gists_url":"https://api.github.com/users/warren-bank/gists{/gist_id}","starred_url":"https://api.github.com/users/warren-bank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warren-bank/subscriptions","organizations_url":"https://api.github.com/users/warren-bank/orgs","repos_url":"https://api.github.com/users/warren-bank/repos","events_url":"https://api.github.com/users/warren-bank/events{/privacy}","received_events_url":"https://api.github.com/users/warren-bank/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T20:54:01Z","updated_at":"2015-08-10T20:54:01Z","body":"oops.. I have to correct myself on that..\r\nif you look at the function: [\"get_HTTP_headers\"](https://raw.githubusercontent.com/warren-bank/moz-rewrite/js/Cu.evalInSandbox/master/components/03_monolithic_addon/moz-rewrite.js),\r\nyou'll see that the following statement is commented out:\r\n> `if (! self.is_case_sensitive) header_key = header_key.toLowerCase()`\r\n\r\nAt one point, the preference that I mentioned controlled the normalization of both:\r\n* URL property values\r\n* HTTP header property names\r\n\r\nBut, I must have decided at some point that I couldn't think of any possible reason to not normalize the property names. To do so would create too many potential problems.\r\n\r\n__examples__:\r\n\r\n1. the case of the headers defined in the rules file doesn't match the case of the headers returned by the server\r\n2. two or more rules match a given url, and the case of the headers they define differ. If the intention was for subsequent rules to override earlier rules, then the actual result would be undefined (since there is no guaranteed order while iterating over the properties of an object).\r\n\r\nIt makes sense to me why I chose to force the header properties to be lowercase.\r\nAnd you're right, this should be better documented. :)"}}