oauth2orize icon indicating copy to clipboard operation
oauth2orize copied to clipboard

Missing trailing newline in responses and json pretty printing

Open alex94cp opened this issue 8 years ago • 0 comments

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?

alex94cp avatar Jul 11 '15 20:07 alex94cp