New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨Request Bank: Fixed AMP CORs and Multipart form data #20879
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for improving our bank!
build-system/amp-cors.js
Outdated
} | ||
} | ||
|
||
module.exports = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can do:
module.exports = enableCors;
and to import
const enableCors = require('./amp-cors');
}); | ||
app.use( | ||
'/request-bank/:bid/deposit/:id/', | ||
upload.array(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i suppose this is a no-op for non-form POST?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Fixed AMP CORs and Multipart form data for Request Bank * Made requested changes
* Fixed AMP CORs and Multipart form data for Request Bank * Made requested changes
closes #20868
closes #20869
relates to #20541
This adds multipart form data parsing into the request body, which AMP Form uses, to the RequestBank Express Middleware, as well as, enables AMP Cors on request bank (which included some refactoring in other places).
Example Requests
These examples are made from just switching around the endpoint of the POST request on the recaptcha example
Submitting to a standard endpoint on the dev server
Depositing to request bank
Withdrawing from request bank