title: WebdriverIO - How to add custom headers to all requests
body: <p>I need to add custom headers to all requests in order to access the web app which is normally hidden behind corporate proxy and vpn and be able to run E2E tests. As an automation tool we user WebdriverIO. So far I tried to set up custom header in wdio.conf.js file following official wdio documentation (<a href="https://webdriver.io/docs/options/" rel="nofollow noreferrer">https://webdriver.io/docs/options/</a>) and added headers option inside capabilities in my config file. Unfortunately, this is not working and I still can't connect to our web app. Has anyone tried to add custom headers in wdio.config.js file and run E2E tests?
  Contents of my wdio.config.js file are following:</p>
  <pre><code>        exports.config = {
        runner: 'local',
      
        specs: [
          './src/specs/**/login.spec.ts',
        ],
        // Patterns to exclude.
        exclude: [
          // 'path/to/excluded/files'
        ],
      
        maxInstances: 10,
      
        capabilities: [
          {
            maxInstances: 5,
            browserName: 'chrome',
            acceptInsecureCerts: true,
      
            headers: {
              'REQUIRED-HEADER-KEY': 'HEADER-VALUE'
            },
      
            'goog:chromeOptions': {
              'excludeSwitches': [
                'enable-automation'
              ],
              prefs: {
                'profile.managed_default_content_settings.notifications': 1, 
                'plugins.always_open_pdf_externally': true, 
                'download': {
                  'prompt_for_download': false, 
                  'default_directory': process.cwd() + '/tmp'
                }
              },
              args: [
                '--disable-gpu',
                '--window-size=1920,1080',
                '--no-sandbox',
                '--disable-dev-shm-usage',
                '--start-maximized',
              ],
            },
          },
        ],
  }
  </code></pre>