Closed
Description
Environment information
Version: express 5.0.0-beta.3
Platform: Linux
Node.js version: 18.x
Any other relevant information: N/A
What steps will reproduce the bug?
- Create a very long string with many IP addresses separated by commas
- Call the
compileTrust
function with this string - Call the returned function and check its length
const utils = require('./lib/utils');
// Create a string with 1,000,001 IP addresses
const longString = Array(1000001).fill('127.0.0.1').join(',');
// Call compileTrust with the long string
const result = utils.compileTrust(longString);
// Check the length of the result when called
console.log(result().length); // Expected: 1000001, Actual: undefined
What is the expected behavior?
The function should correctly process the very long string, split it into an array of IP addresses, and return a function that, when called, returns an array with 1,000,001 elements (one for each IP address in the original string).
What happens instead?
When calling the result function and checking its length, it returns undefined instead of the expected value of 1,000,001.
When processing a string input, the function splits the string and maps the values, but doesn't ensure the returned function properly returns the processed array for very long inputs. There's inconsistency in how the function handles string inputs compared to other input types.