This commit is contained in:
2025-07-22 11:28:06 +00:00
parent ffc04c5b85
commit 4fea28ffb7
36 changed files with 100 additions and 331 deletions

View File

@@ -49,11 +49,15 @@ export class HttpDetector implements IProtocolDetector {
return null;
}
// Check if we have complete headers first
const headersEnd = buffer.indexOf('\r\n\r\n');
const isComplete = headersEnd !== -1;
// Extract routing information
const routing = RoutingExtractor.extract(buffer, 'http');
// If we don't need full headers, we can return early
if (quickResult.confidence >= 95 && !options?.extractFullHeaders) {
// If we don't need full headers and we have complete headers, we can return early
if (quickResult.confidence >= 95 && !options?.extractFullHeaders && isComplete) {
return {
protocol: 'http',
connectionInfo: {
@@ -66,10 +70,6 @@ export class HttpDetector implements IProtocolDetector {
};
}
// Check if we have complete headers
const headersEnd = buffer.indexOf('\r\n\r\n');
const isComplete = headersEnd !== -1;
return {
protocol: 'http',
connectionInfo: {