TASK22028: phase 16 file-proxy guard consistency slice
This commit is contained in:
@@ -1,36 +1,19 @@
|
||||
import {
|
||||
downloadAllProgressFiles,
|
||||
getAllProgressBlobs
|
||||
} from "../../../actions/azurestorage";
|
||||
import _ from "lodash";
|
||||
import nextConnect from "next-connect";
|
||||
import middleware from "../middleware/middleware";
|
||||
import { getToken } from "../../../actions/core/token";
|
||||
import { azureHeaders } from "../../../actions/core/headers";
|
||||
import { consoleLogger } from "../../../actions/core/logger";
|
||||
import { hashAPIPath } from "../../../actions/core/hash";
|
||||
import axios from "axios";
|
||||
import CryptoJS from "crypto-js";
|
||||
|
||||
const WORDKEY = process.env.HASHKEY;
|
||||
|
||||
const WEBAPI_URL =
|
||||
process.env.RELAY_ROOT ||
|
||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||
|
||||
const BASE_URL = process.env.API_ROOT || `http://localhost:${port}`;
|
||||
|
||||
const hasValue = (value) =>
|
||||
typeof value === "string" && value.trim().length > 0;
|
||||
|
||||
export default async function ApiProxy(req, res) {
|
||||
var containerName = req.query.container;
|
||||
var casefolderID = req.query.casefolderID;
|
||||
var checkHash = req.query.hash;
|
||||
|
||||
if (
|
||||
typeof containerName === "undefined" ||
|
||||
containerName.length === 0 ||
|
||||
typeof casefolderID === "undefined" ||
|
||||
casefolderID.length === 0
|
||||
) {
|
||||
if (!hasValue(containerName) || !hasValue(casefolderID)) {
|
||||
return res.status(400).json();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user