oauth2orize
oauth2orize copied to clipboard
Missing trailing newline in responses and json pretty printing
oauth2orize middleware uses res.end to send back authorization responses. As a result, responses lack the trailing newline at the end, which makes using curl to test oauth endpoints "funny". It also makes pretty-printing (setting the "json spaces" option in express) quite difficult, which makes oauth2orize endpoints different from the rest of endpoints. Express explicitly recommends using res.send or res.json instead of res.end for sending data.
I tried to make a pull request, but the majority of unit tests depend on the exact format of the responses. Would a patch that makes tests parse the responses as JSON and then test its properties individually be welcome?