import { BaseRequestPolicy , WebResource } from "@azure/storage-blob" ; export default class OriginPolicyFactory { private origin : string ; constructor ( origin ) { this . origin = origin ; } create ( nextPolicy , options ) { return new OriginPolicy ( nextPolicy , options , this . origin ) ; } } class OriginPolicy extends BaseRequestPolicy { private origin : string ; constructor ( nextPolicy , options , origin ) { super ( nextPolicy , options ) ; this . origin = origin ; } async sendRequest ( request ) { request . headers . set ( "Origin" , `${ this . origin }` ) ; const response = await this . _nextPolicy . sendRequest ( request ) ; return response ; } }