This commit is contained in:
rijkvanzanten
2023-04-14 17:30:56 -04:00
parent bdb1a919e2
commit 37658802b7
119 changed files with 224 additions and 0 deletions

View File

@@ -310,6 +310,7 @@ export default async function getASTFromQuery(
if (fieldKey === '*') {
const aliases = Object.keys(query.alias ?? {});
// Set to all fields in collection
if (allowedFields.includes('*')) {
fields.splice(index, 1, ...fieldsInCollection, ...aliases);

View File

@@ -13,8 +13,10 @@ export function shouldSkipCache(req: Request): boolean {
// Always skip cache for requests coming from the data studio based on Referer header
const referer = req.get('Referer');
if (referer) {
const adminUrl = new Url(env['PUBLIC_URL']).addPath('admin');
if (adminUrl.isRootRelative()) {
const refererUrl = new Url(referer);
if (refererUrl.path.join('/').startsWith(adminUrl.path.join('/'))) return true;

View File

@@ -72,6 +72,7 @@ export function validateSnapshot(snapshot: Snapshot, force = false) {
}
const currentVendor = getDatabaseClient();
if (snapshot.vendor !== currentVendor) {
throw new InvalidPayloadException(
`Provided snapshot's vendor ${snapshot.vendor} does not match the current instance's vendor ${currentVendor}. You can bypass this check by passing the "force" query parameter.`