I have two servers; receiving server(1) runs on NodeJS, and the sender server(2) is on Python rasa nlu.
Server(1) code :
import {Storage} from "@google-cloud/storage";
this.post("/webhook",
async (req, res) => {
const storage = new Storage({/** google credential filename */ });
const clientBucket = storage.bucket(/** bucket name */);
// Create a reference to a file object
const fileName = `${moment().format("YYYYMMDDHHmmss")}.tar.gz`;
const file = clientBucket.file(fileName);
req.pipe(file.createWriteStream());
req.on("end", () => {
// have to update in db that file has been uploaded
});
})
Problem: When running both servers on HTTP file uploading works fine and I received the whole file. But if any one server is on HTTPS it stops working and only gets a few chunks of data or not.