{"action":"created","issue":{"url":"https://api.github.com/repos/pussinboots/angularjs-crypto/issues/3","labels_url":"https://api.github.com/repos/pussinboots/angularjs-crypto/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/pussinboots/angularjs-crypto/issues/3/comments","events_url":"https://api.github.com/repos/pussinboots/angularjs-crypto/issues/3/events","html_url":"https://github.com/pussinboots/angularjs-crypto/issues/3","id":72643540,"number":3,"title":"Stringifying an object won't crypt the raw data","user":{"login":"amiral84","id":9930911,"avatar_url":"https://avatars.githubusercontent.com/u/9930911?v=3","gravatar_id":"","url":"https://api.github.com/users/amiral84","html_url":"https://github.com/amiral84","followers_url":"https://api.github.com/users/amiral84/followers","following_url":"https://api.github.com/users/amiral84/following{/other_user}","gists_url":"https://api.github.com/users/amiral84/gists{/gist_id}","starred_url":"https://api.github.com/users/amiral84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amiral84/subscriptions","organizations_url":"https://api.github.com/users/amiral84/orgs","repos_url":"https://api.github.com/users/amiral84/repos","events_url":"https://api.github.com/users/amiral84/events{/privacy}","received_events_url":"https://api.github.com/users/amiral84/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-02T13:10:08Z","updated_at":"2015-05-02T15:58:38Z","closed_at":"2015-05-02T15:58:38Z","body":"Today I made a test where I send an stringified object to server. It seems that if you use\r\n   \r\n    JSON.stringify({object})\r\n\r\nthe raw data will not be crypted even though in query crypt is set to true. For example if I pass\r\n\r\n    JSON.stringify({object})\r\n\r\nto userData in following service call:\r\n\r\n    myFunction: function(userData){\r\n        return $http.post('/someURL', userData, {crypt: true}).success(function(data){\r\n            return data;\r\n        });\r\n    }\r\n\r\nand you console log the sent data you see the actual raw data even if you have put _enc after fields you want to be encrypted. Either this could be fixed in the code or could be added in documentation."},"comment":{"url":"https://api.github.com/repos/pussinboots/angularjs-crypto/issues/comments/98373650","html_url":"https://github.com/pussinboots/angularjs-crypto/issues/3#issuecomment-98373650","issue_url":"https://api.github.com/repos/pussinboots/angularjs-crypto/issues/3","id":98373650,"user":{"login":"pussinboots","id":541464,"avatar_url":"https://avatars.githubusercontent.com/u/541464?v=3","gravatar_id":"","url":"https://api.github.com/users/pussinboots","html_url":"https://github.com/pussinboots","followers_url":"https://api.github.com/users/pussinboots/followers","following_url":"https://api.github.com/users/pussinboots/following{/other_user}","gists_url":"https://api.github.com/users/pussinboots/gists{/gist_id}","starred_url":"https://api.github.com/users/pussinboots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pussinboots/subscriptions","organizations_url":"https://api.github.com/users/pussinboots/orgs","repos_url":"https://api.github.com/users/pussinboots/repos","events_url":"https://api.github.com/users/pussinboots/events{/privacy}","received_events_url":"https://api.github.com/users/pussinboots/received_events","type":"User","site_admin":false},"created_at":"2015-05-02T15:58:38Z","updated_at":"2015-05-02T15:58:38Z","body":"Hi,\r\n\r\ni expand the documentation with a section that explained the Header Content-Type check feature.\r\nThere is a two way check for every Response and Request and only if they fulfill both conditions than the decrpytion/encryption process will be accomplished. First it will check if the crypt property is true and then if the Content-Type HTTP Header is equal to 'application/json' or 'application/json_enc'. The new section explain how to add also other Content-Type that you want to be encrypted or decrypted. \r\nThere is also mentioned how you can change the Header Content-Type check implementation itself.\r\n\r\nThat was not mentioned in the deocumentation before. Maybe that was why your test failed hopefully. "}}