Spaces:
Paused
Paused
Update index.js
Browse files
index.js
CHANGED
|
@@ -38,7 +38,11 @@ const youtube = google.youtube({ version: 'v3', auth: 'AIzaSyBPkpdJEGtAHebbaP3_C
|
|
| 38 |
|
| 39 |
|
| 40 |
const tempDirBase = tempDir
|
|
|
|
| 41 |
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
app.use('/temp', express.static(tempDir));
|
| 44 |
app.use(express.json());
|
|
@@ -51,6 +55,7 @@ app.all('/axios/:method/*', async (req, res) => {
|
|
| 51 |
try {
|
| 52 |
const response = await axios({
|
| 53 |
method: method.toLowerCase(),
|
|
|
|
| 54 |
url: targetUrl,
|
| 55 |
headers: req.headers,
|
| 56 |
data: req.method === 'POST' ? req.body : undefined, // Hanya kirim data jika metode adalah POST
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
const tempDirBase = tempDir
|
| 41 |
+
const https = require('https');
|
| 42 |
|
| 43 |
+
const agent = new https.Agent({
|
| 44 |
+
rejectUnauthorized: false // Nonaktifkan verifikasi sertifikat
|
| 45 |
+
});
|
| 46 |
|
| 47 |
app.use('/temp', express.static(tempDir));
|
| 48 |
app.use(express.json());
|
|
|
|
| 55 |
try {
|
| 56 |
const response = await axios({
|
| 57 |
method: method.toLowerCase(),
|
| 58 |
+
httpsAgent: agent,
|
| 59 |
url: targetUrl,
|
| 60 |
headers: req.headers,
|
| 61 |
data: req.method === 'POST' ? req.body : undefined, // Hanya kirim data jika metode adalah POST
|