From ce3af94a693aa05e90416649f832f36b62630c69 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Apr 2017 07:19:44 +0100 Subject: mantis 6738: change parsing of the HTTP_CUSTOM_HEADER parameter and ignore entries in excess of 8 on the request --- .../CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/CoreModules/Scripting') diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index 09891f7..035097f 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -223,20 +223,16 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest if (parms.Length - i < 2) break; - //Have we reached the end of the list of headers? - //End is marked by a string with a single digit. - //We already know we have at least one parameter - //so it is safe to do this check at top of loop. - if (Char.IsDigit(parms[i][0])) - break; - if (htc.HttpCustomHeaders == null) htc.HttpCustomHeaders = new List(); htc.HttpCustomHeaders.Add(parms[i]); htc.HttpCustomHeaders.Add(parms[i+1]); + int nexti = i + 2; + if (nexti >= parms.Length || Char.IsDigit(parms[nexti][0])) + break; - i += 2; + i = nexti; } break; -- cgit v1.1