Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import firebase from '@firebase/app';
/** The semver (www.semver.org) version of the SDK. */
export const SDK_VERSION = firebase.SDK_VERSION;
function addVersionHeader_(headers) {
var version = typeof firebase !== 'undefined' ? firebase.SDK_VERSION : 'AppManager';
headers['X-Firebase-Storage-Version'] = 'webjs/' + version;
}
/**
function addVersionHeader_(headers) {
const version = typeof firebase !== 'undefined' ? firebase.SDK_VERSION : 'AppManager';
headers['X-Firebase-Storage-Version'] = 'webjs/' + version;
}
/**
function addVersionHeader_(headers) {
const version = typeof firebase !== 'undefined' ? firebase.SDK_VERSION : 'AppManager';
headers['X-Firebase-Storage-Version'] = 'webjs/' + version;
}
/**
function addVersionHeader_(headers) {
var version = typeof firebase !== 'undefined' ? firebase.SDK_VERSION : 'AppManager';
headers['X-Firebase-Storage-Version'] = 'webjs/' + version;
}
/**
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as grpc from 'grpc';
import firebase from '@firebase/app';
const SDK_VERSION = firebase.SDK_VERSION;
const grpcVersion = require('grpc/package.json').version;
import { Token } from '../api/credentials';
import { DatabaseInfo } from '../core/database_info';
import { Connection, Stream } from '../remote/connection';
import { mapCodeFromRpcCode } from '../remote/rpc_error';
import { StreamBridge } from '../remote/stream_bridge';
import { assert } from '../util/assert';
import { FirestoreError } from '../util/error';
import * as log from '../util/log';
import { NodeCallback, nodePromise } from '../util/node_api';
import { Deferred } from '../util/promise';
const LOG_TAG = 'Connection';
export function addVersionHeader_(headers: Headers): void {
const version =
typeof firebase !== 'undefined' ? firebase.SDK_VERSION : 'AppManager';
headers['X-Firebase-Storage-Version'] = 'webjs/' + version;
}