Skip to content

Commit

Permalink
paypro: example - use strict paypro headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Aug 13, 2014
1 parent 82ce08b commit 076dab2
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions examples/PayPro/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,18 @@ app.use(function(req, res, next) {
};

res.setHeader('Access-Control-Allow-Origin', '*');

if (req.method === 'OPTIONS') {
res.setHeader('Access-Control-Allow-Methods', 'GET,POST');
res.setHeader('Access-Control-Allow-Headers', req.headers['access-control-request-headers']);
return res.send(200);
}
res.setHeader('Access-Control-Allow-Methods', 'GET,POST');
res.setHeader('Access-Control-Allow-Headers', [
'Host',
'Connection',
'Content-Length',
'Accept',
'Origin',
'User-Agent',
'Content-Type',
'Accept-Encoding',
'Accept-Language'
].join(','));

res.setHeader('Accept', PayPro.PAYMENT_CONTENT_TYPE);

Expand Down

0 comments on commit 076dab2

Please sign in to comment.