lib/plugins/aws/deploy/compile/events/apiGateway/lib/methods.js/hasResponseHeaders
    const hasResponseHeaders = (event) => {
      // check if custom response configuration should be used
      if (Boolean(event.http.response) === true) {
        if (typeof event.http.response === 'object') {
          // prepare the headers if set
          if (Boolean(event.http.response.headers) === true) {
            if (typeof event.http.response.headers === 'object') {
              return true;
            }

            const errorMessage = [
              'Response headers must be provided as an object.',
              ' Please check the docs for more info.',
            ].join('');
            throw new this.serverless.classes.Error(errorMessage);
          }
        } else {
          const errorMessage = [
            'Response config must be provided as an object.',
            ' Please check the docs for more info.',
          ].join('');
          throw new this.serverless.classes.Error(errorMessage);
        }
      }

      return false;
    };