Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

264
Views
How to fix CORS policy issue with get request?

please help me to solve CORS policy issue, it happens when I'm trying to make a get request to applications endpoint, and issue is only reproducible from http://localhost:8080/ on prod request works fine.

vue.config.js file

module.exports = {
    devServer: {
        proxy: 'https://spinstatus.zenoss.io/'
    }
}

request method

const grabApps = async () => {
  const res = await axios({
    method: 'get',
    url: `${spinnakerURL}/gate/applications`,
    withCredentials: false,
    crossdomain: true,
    headers: {
      'Access-Control-Allow-Origin': '*',
    }
  });
  return res.data || []
}

error

headers from localhost request

headers from prod request

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Change the devServer configuration in vue.config.js like this:

module.exports = {
  devServer:
  {
    proxy:
    {
      '/gate':
      {
        target: 'https://spinstatus.zenoss.io',
        changeOrigin: true,
        onProxyReq: (proxyReq, req, res, options) =>
        {
          proxyReq.setHeader('Origin', 'https://spinstatus.zenoss.io');
        }
      }
    }
  }
};
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!