decodeRequest(event) {
        const path = event["path"];
        if (path !== undefined) {
            const encoded = path.charAt(0) === '/' ? path.slice(1) : path;
            const toBuffer = Buffer.from(encoded, 'base64');
            try {
                // To support European characters, 'ascii' was removed.
                return JSON.parse(toBuffer.toString());
            } catch (e) {
                throw ({
                    status: 400,
                    code: 'DecodeRequest::CannotDecodeRequest',
                    message: 'The image request you provided could not be decoded. Please check that your request is base64 encoded properly and refer to the documentation for additional guidance.'
                });
            }
        } else {
            throw ({
                status: 400,
                code: 'DecodeRequest::CannotReadPath',
                message: 'The URL path you provided could not be read. Please ensure that it is properly formed according to the solution documentation.'
            });
        }
    }
/**
     * Decodes the base64-encoded image request path associated with default
     * image requests. Provides error handling for invalid or undefined path values.
     * @param {object} event - The proxied request object.
     */
Decodes the base64-encoded image request path associated with default
image requests. Provides error handling for invalid or undefined path values.
@param {object} event - The proxied request object.
Decodes the base64 - encoded image request path associated with default image requests . Provides error handling for invalid or undefined path values . @param { object } event - The proxied request object .
decodeRequest(event) {
        const path = event["path"];
        if (path !== undefined) {
            const encoded = path.charAt(0) === '/' ? path.slice(1) : path;
            const toBuffer = Buffer.from(encoded, 'base64');
            try {
                return JSON.parse(toBuffer.toString());
            } catch (e) {
                throw ({
                    status: 400,
                    code: 'DecodeRequest::CannotDecodeRequest',
                    message: 'The image request you provided could not be decoded. Please check that your request is base64 encoded properly and refer to the documentation for additional guidance.'
                });
            }
        } else {
            throw ({
                status: 400,
                code: 'DecodeRequest::CannotReadPath',
                message: 'The URL path you provided could not be read. Please ensure that it is properly formed according to the solution documentation.'
            });
        }
    }
decodeRequest ( event ) { const path = event [ "path" ] ; if ( path !== undefined ) { const encoded = path . charAt ( 0 ) === '/' ? path . slice ( 1 ) : path ; const toBuffer = Buffer . from ( encoded , 'base64' ) ; try { return JSON . parse ( toBuffer . toString ( ) ) ; } catch ( e ) { throw ( { status : 400 , code : 'DecodeRequest::CannotDecodeRequest' , message : 'The image request you provided could not be decoded. Please check that your request is base64 encoded properly and refer to the documentation for additional guidance.' } ) ; } } else { throw ( { status : 400 , code : 'DecodeRequest::CannotReadPath' , message : 'The URL path you provided could not be read. Please ensure that it is properly formed according to the solution documentation.' } ) ; } }
Decodes the base64-encoded image request path associated with default
 image requests.
Decodes the base64 - encoded image request path associated with default image requests .
// To support European characters, 'ascii' was removed.