meta-fca 2.5.9 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils.js +30 -32
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meta-fca",
3
- "version": "2.5.9",
3
+ "version": "2.6.2",
4
4
  "description": "Comback :))",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/utils.js CHANGED
@@ -28,22 +28,20 @@ function setProxy(url) {
28
28
  */
29
29
 
30
30
  function getHeaders(url, options, ctx, customHeader) {
31
- var headers = {
32
- "Content-Type": "application/x-www-form-urlencoded",
33
- Referer: "https://www.facebook.com/",
34
- Host: url.replace("https://", "").split("/")[0],
35
- Origin: "https://www.facebook.com",
36
- "User-Agent": options.userAgent,
37
- Connection: "keep-alive"
38
- };
39
- if (customHeader) {
40
- Object.assign(headers, customHeader);
41
- }
42
- if (ctx && ctx.region) {
43
- headers["X-MSGR-Region"] = ctx.region;
44
- }
45
-
46
- return headers;
31
+ var headers = {
32
+ "Content-Type": "application/x-www-form-urlencoded",
33
+ Referer: "https://www.facebook.com/",
34
+ Host: url.replace("https://", "").split("/")[0],
35
+ Origin: "https://www.facebook.com",
36
+ "user-agent": (options.userAgent || "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36"),
37
+ Connection: "keep-alive",
38
+ "sec-fetch-site": 'same-origin',
39
+ "sec-fetch-mode": 'cors'
40
+ };
41
+ if (customHeader) Object.assign(headers, customHeader);
42
+ if (ctx && ctx.region) headers["X-MSGR-Region"] = ctx.region;
43
+
44
+ return headers;
47
45
  }
48
46
 
49
47
  /**
@@ -116,22 +114,22 @@ fb_dtsg: any; jazoest: any; }} qs
116
114
  */
117
115
 
118
116
  function postFormData(url, jar, form, qs, options, ctx) {
119
- var headers = getHeaders(url, options, ctx);
120
- headers["Content-Type"] = "multipart/form-data";
121
- var op = {
122
- headers: headers,
123
- timeout: 60000,
124
- url: url,
125
- method: "POST",
126
- formData: form,
127
- qs: qs,
128
- jar: jar,
129
- gzip: true
130
- };
131
-
132
- return request(op).then(function (res) {
133
- return res[0];
134
- });
117
+ var headers = getHeaders(url, options, ctx);
118
+ headers["Content-Type"] = "multipart/form-data";
119
+ var op = {
120
+ headers: headers,
121
+ timeout: 60000,
122
+ url: url,
123
+ method: "POST",
124
+ formData: form,
125
+ qs: qs,
126
+ jar: jar,
127
+ gzip: true
128
+ };
129
+
130
+ return request(op).then(function(res) {
131
+ return res;
132
+ });
135
133
  }
136
134
 
137
135
  /**