@netlify/plugin-nextjs
Advanced tools
Comparing version 5.2.1 to 5.2.2
@@ -19,5 +19,3 @@ import { | ||
const requestContext = createRequestContext( | ||
req.headers.get('x-nf-debug-logging') || req.headers.get('x-next-debug-logging'), | ||
) | ||
const requestContext = createRequestContext(req.headers.get('x-next-debug-logging')) | ||
const tracer = getTracer() | ||
@@ -24,0 +22,0 @@ |
@@ -16,5 +16,3 @@ import { | ||
} | ||
const requestContext = createRequestContext( | ||
req.headers.get('x-nf-debug-logging') || req.headers.get('x-next-debug-logging'), | ||
) | ||
const requestContext = createRequestContext(req.headers.get('x-next-debug-logging')) | ||
const tracer = getTracer() | ||
@@ -21,0 +19,0 @@ |
@@ -61,3 +61,3 @@ | ||
const netlifyVaryValues = { | ||
header: ["x-nextjs-data"], | ||
header: ["x-nextjs-data", "x-next-debug-logging"], | ||
language: [], | ||
@@ -64,0 +64,0 @@ cookie: ["__prerender_bypass", "__next_preview_data"], |
@@ -7,102 +7,73 @@ | ||
import { | ||
__commonJS, | ||
__require, | ||
__toESM | ||
} from "../esm-chunks/chunk-5JVNISGM.js"; | ||
import "../esm-chunks/chunk-5JVNISGM.js"; | ||
// node_modules/@netlify/functions/dist/lib/system_logger.js | ||
var require_system_logger = __commonJS({ | ||
"node_modules/@netlify/functions/dist/lib/system_logger.js"(exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.systemLogger = exports.LogLevel = void 0; | ||
var process_1 = __require("process"); | ||
var systemLogTag = "__nfSystemLog"; | ||
var serializeError = (error) => { | ||
const cause = error?.cause instanceof Error ? serializeError(error.cause) : error.cause; | ||
return { | ||
error: error.message, | ||
error_cause: cause, | ||
error_stack: error.stack | ||
}; | ||
}; | ||
var LogLevel2; | ||
(function(LogLevel3) { | ||
LogLevel3[LogLevel3["Debug"] = 1] = "Debug"; | ||
LogLevel3[LogLevel3["Log"] = 2] = "Log"; | ||
LogLevel3[LogLevel3["Error"] = 3] = "Error"; | ||
})(LogLevel2 = exports.LogLevel || (exports.LogLevel = {})); | ||
var SystemLogger = class _SystemLogger { | ||
fields; | ||
logLevel; | ||
constructor(fields = {}, logLevel = LogLevel2.Log) { | ||
this.fields = fields; | ||
this.logLevel = logLevel; | ||
} | ||
doLog(logger, message) { | ||
if (process_1.env.NETLIFY_DEV && !process_1.env.NETLIFY_ENABLE_SYSTEM_LOGGING) { | ||
return; | ||
} | ||
logger(systemLogTag, JSON.stringify({ msg: message, fields: this.fields })); | ||
} | ||
log(message) { | ||
if (this.logLevel > LogLevel2.Log) { | ||
return; | ||
} | ||
this.doLog(console.log, message); | ||
} | ||
debug(message) { | ||
if (this.logLevel > LogLevel2.Debug) { | ||
return; | ||
} | ||
this.doLog(console.debug, message); | ||
} | ||
error(message) { | ||
if (this.logLevel > LogLevel2.Error) { | ||
return; | ||
} | ||
this.doLog(console.error, message); | ||
} | ||
withLogLevel(level) { | ||
return new _SystemLogger(this.fields, level); | ||
} | ||
withFields(fields) { | ||
return new _SystemLogger({ | ||
...this.fields, | ||
...fields | ||
}, this.logLevel); | ||
} | ||
withError(error) { | ||
const fields = error instanceof Error ? serializeError(error) : { error }; | ||
return this.withFields(fields); | ||
} | ||
}; | ||
exports.systemLogger = new SystemLogger(); | ||
// node_modules/@netlify/functions/dist/chunk-HYMERDCV.mjs | ||
import { env } from "process"; | ||
var systemLogTag = "__nfSystemLog"; | ||
var serializeError = (error) => { | ||
const cause = error?.cause instanceof Error ? serializeError(error.cause) : error.cause; | ||
return { | ||
error: error.message, | ||
error_cause: cause, | ||
error_stack: error.stack | ||
}; | ||
}; | ||
var LogLevel = /* @__PURE__ */ ((LogLevel2) => { | ||
LogLevel2[LogLevel2["Debug"] = 1] = "Debug"; | ||
LogLevel2[LogLevel2["Log"] = 2] = "Log"; | ||
LogLevel2[LogLevel2["Error"] = 3] = "Error"; | ||
return LogLevel2; | ||
})(LogLevel || {}); | ||
var SystemLogger = class _SystemLogger { | ||
fields; | ||
logLevel; | ||
constructor(fields = {}, logLevel = 2) { | ||
this.fields = fields; | ||
this.logLevel = logLevel; | ||
} | ||
}); | ||
// node_modules/@netlify/functions/dist/internal.js | ||
var require_internal = __commonJS({ | ||
"node_modules/@netlify/functions/dist/internal.js"(exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LogLevel = exports.systemLogger = void 0; | ||
var system_logger_js_1 = require_system_logger(); | ||
Object.defineProperty(exports, "systemLogger", { enumerable: true, get: function() { | ||
return system_logger_js_1.systemLogger; | ||
} }); | ||
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function() { | ||
return system_logger_js_1.LogLevel; | ||
} }); | ||
doLog(logger, message) { | ||
if (env.NETLIFY_DEV && !env.NETLIFY_ENABLE_SYSTEM_LOGGING) { | ||
return; | ||
} | ||
logger(systemLogTag, JSON.stringify({ msg: message, fields: this.fields })); | ||
} | ||
}); | ||
// src/run/systemlog.ts | ||
var import_internal = __toESM(require_internal(), 1); | ||
var export_LogLevel = import_internal.LogLevel; | ||
var export_logger = import_internal.systemLogger; | ||
log(message) { | ||
if (this.logLevel > 2) { | ||
return; | ||
} | ||
this.doLog(console.log, message); | ||
} | ||
debug(message) { | ||
if (this.logLevel > 1) { | ||
return; | ||
} | ||
this.doLog(console.debug, message); | ||
} | ||
error(message) { | ||
if (this.logLevel > 3) { | ||
return; | ||
} | ||
this.doLog(console.error, message); | ||
} | ||
withLogLevel(level) { | ||
return new _SystemLogger(this.fields, level); | ||
} | ||
withFields(fields) { | ||
return new _SystemLogger( | ||
{ | ||
...this.fields, | ||
...fields | ||
}, | ||
this.logLevel | ||
); | ||
} | ||
withError(error) { | ||
const fields = error instanceof Error ? serializeError(error) : { error }; | ||
return this.withFields(fields); | ||
} | ||
}; | ||
var systemLogger = new SystemLogger(); | ||
export { | ||
export_LogLevel as LogLevel, | ||
export_logger as logger | ||
LogLevel, | ||
systemLogger as logger | ||
}; |
@@ -6,2 +6,4 @@ import type { Context } from '@netlify/edge-functions' | ||
import type { StructuredLogger } from './logging.ts' | ||
import { addMiddlewareHeaders, isMiddlewareRequest, isMiddlewareResponse } from './middleware.ts' | ||
import { RequestData } from './next-request.ts' | ||
import { | ||
@@ -14,4 +16,2 @@ addBasePath, | ||
} from './util.ts' | ||
import { addMiddlewareHeaders, isMiddlewareRequest, isMiddlewareResponse } from './middleware.ts' | ||
import { RequestData } from './next-request.ts' | ||
@@ -187,4 +187,7 @@ export interface FetchEventResult { | ||
rewriteUrl.searchParams.set('__nextDataReq', '1') | ||
rewriteUrl.pathname = normalizeTrailingSlash(rewriteUrl.pathname, nextConfig?.trailingSlash) | ||
} | ||
// respect trailing slash rules to prevent 308s | ||
rewriteUrl.pathname = normalizeTrailingSlash(rewriteUrl.pathname, nextConfig?.trailingSlash) | ||
const target = normalizeLocalizedTarget({ target: rewriteUrl.toString(), request, nextConfig }) | ||
@@ -191,0 +194,0 @@ if (target === request.url) { |
{ | ||
"name": "@netlify/plugin-nextjs", | ||
"version": "5.2.1", | ||
"version": "5.2.2", | ||
"description": "Run Next.js seamlessly on Netlify", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3
5262723
138328