@@ -38,10 +38,6 @@ interface LogEntry {
3838}
3939
4040function logRequest ( entry : LogEntry ) {
41- // Only log if debug enabled or it's an error?
42- // User said "Debug info must be explicitly enabled".
43- // "Minimum config: Duration, Success/Fail, Upstream Name, Status Code" - this implies basic logs might be always on or structured.
44- // I'll stick to console.log which is standard for edge runtimes, but wrapped.
4541 if ( process . env . DEBUG_LOG === 'true' || entry . status >= 400 ) {
4642 console . log ( JSON . stringify ( entry ) ) ;
4743 }
@@ -58,14 +54,6 @@ function validateRequest(url: URL): NextResponse | null {
5854 // Validate Domain Name (if present in 'name' param for JSON API)
5955 const nameParam = url . searchParams . get ( 'name' ) ;
6056
61- // Strict Validation for 'name' param
62- // Force validation: name parameter MUST exist and be valid for JSON API queries
63- // If user sends raw DNS message via base64 'dns' param, 'name' might be optional.
64- // But for standard DoH JSON API, 'name' is required.
65- // Assuming this proxy primarily serves JSON API or mixed.
66- // If 'dns' param exists (RFC 8484 GET), we might skip 'name' check.
67- // BUT user explicitly asked: "name 必须存在,且长度 ≥ 1" for ALL endpoints.
68-
6957 if ( url . searchParams . has ( 'dns' ) ) {
7058 // RFC 8484 GET (base64 dns message) - 'name' is NOT required
7159 } else {
0 commit comments