Skip to content

Commit

Permalink
temporary commit to let us test new metadatas pointing the Layer API …
Browse files Browse the repository at this point in the history
…to staging while pointing Data API to Production
  • Loading branch information
willian-viana committed Sep 25, 2024
1 parent 943dcda commit 57e04fd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pages/api/metadata/[...params].js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { GFW_DATA_API, GFW_STAGING_DATA_API } from 'utils/apis';
import { GFW_DATA_API } from 'utils/apis';
import axios from 'axios';

const ENVIRONMENT = process.env.NEXT_PUBLIC_FEATURE_ENV;
const GFW_METADATA_API_URL =
ENVIRONMENT === 'staging' ? GFW_STAGING_DATA_API : GFW_DATA_API;
// const ENVIRONMENT = process.env.NEXT_PUBLIC_FEATURE_ENV;
// const GFW_METADATA_API_URL =
// ENVIRONMENT === 'staging' ? GFW_STAGING_DATA_API : GFW_DATA_API;

export default async (req, res) => {
try {
const path = req.query.params.join('/');
const url = `${GFW_METADATA_API_URL}/${path}`;
const url = `${GFW_DATA_API}/${path}`;
const datasetMetadata = await axios.get(url);

Check failure

Code scanning / CodeQL

Server-side request forgery Critical

The
URL
of this request depends on a
user-provided value
.
const datasetVersionMetadata = await axios.get(`${url}/latest/metadata`);

Check failure

Code scanning / CodeQL

Server-side request forgery Critical

The
URL
of this request depends on a
user-provided value
.

Expand Down

0 comments on commit 57e04fd

Please sign in to comment.