Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = async function misconfiguredCORS(url, test) {
- let headers = null;
- try {
- const result = await request
- .get(url)
- .set('Access-Control-Allow-Origin', test)
- .timeout(5000)
- if('access-control-allow-origin' in result.headers) {
- headers = {
- page: url,
- data: result.headers
- }
- }
- } catch (e) {
- return null;
- }
- return headers;
- }
Add Comment
Please, Sign In to add comment