brianloveswords/node-jws — pull request #5 by dbarbera (2014-04-12 22:37:43+00:00)
Title: fix error when using a string as payload and jwt type in the header

Fix an error when using a string as payload and specifying the type "jwt" in the header. At the moment, when the payload is serialized, it is done based in its type, but when is deserialized it checks the header and options to see if it must be parsed as JSON. As a result, it tries to deserialize a normal string as a json string and throws a parse exception. For fixing it, I modified the securedInput function to do the same check that the jwsDecode function.