How to use the @podium/utils.deserializeContext function in @podium/utils

To help you get started, we’ve selected a few @podium/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github podium-lib / podlet / lib / podlet.js View on Github external
}

        // Append development context
        if (incoming.development) {
            incoming.context = Object.assign(
                this.baseContext,
                { mountOrigin: incoming.url.origin },
                this.defaultContext,
            );
            this.log.debug(
                `Appending a default context to inbound request "${JSON.stringify(
                    incoming.context,
                )}"`,
            );
        } else {
            incoming.context = utils.deserializeContext(
                incoming.request.headers,
            );
            this.log.debug(
                `Inbound request contains a context "${JSON.stringify(
                    incoming.context,
                )}"`,
            );
        }

        // Determin if the request should be proxied and do if so
        if (incoming.development && proxy) {
            await this.httpProxy.process(incoming);
        }

        return incoming;
    }

@podium/utils

Common generic utility methods shared by @podium modules.

MIT
Latest version published 13 days ago

Package Health Score

78 / 100
Full package analysis