@niledatabase/server 4.0.0-alpha.12 → 4.0.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1983,7 +1983,15 @@ var Auth = class extends Config {
1983
1983
  handleHeaders(init) {
1984
1984
  if (this.headers) {
1985
1985
  const cburl = getCallbackUrl2(this.headers);
1986
- this.headers.set(X_NILE_ORIGIN, new URL(cburl).origin);
1986
+ if (cburl) {
1987
+ try {
1988
+ this.headers.set(X_NILE_ORIGIN, new URL(cburl).origin);
1989
+ } catch (e) {
1990
+ if (this.logger?.debug) {
1991
+ this.logger.debug("Invalid URL supplied by cookie header");
1992
+ }
1993
+ }
1994
+ }
1987
1995
  if (init) {
1988
1996
  init.headers = new Headers({ ...this.headers, ...init?.headers });
1989
1997
  return init;