From: "F. Senault" Date: 2009-03-30T18:05:01+09:00 Subject: Re: Symbols garbage collector in Ruby1.9, fixed? Le 30 mars 2009 � 10:09, I�aki Baz Castillo a �crit : > The problem is that I could receive custom headers so for each one a > new Symbol would be created. An attacker could send lots of custom > headers to fill the server memory and cause a denial of service. > > Perhaps this is solved in Ruby 1.9? any suggestion on it? Thanks a lot. It depends on what exactly you are trying to do with your hash. If you need to access to a few well known headers in your code, use symbols for those and add another pseudo-header for the rest of the info : USEFUL_HEADERS = [ :from, :to, :"x-mailer" ] headers = { :from => "alice@aaa.com", :to => "bob@bbb.com", :"x-mailer" => "Pegasus Mail for Windows (4.50 PB1)", :"_custom" => { "x-custom-header-1" => "Hi there", "x-spam-scanned" => "Of course" } } (Now, you'll lose time at the parse step. Again, depending on what you're trying to do, it may be efficient if each mail is parsed one time and, then, each header is accessed a lot of times.) Fred -- Well I'm the one without a soul I'm the one with this big fucking hole No new tale to tell Twenty-six years on my way to hell Gotta listen to your big time hard line bad luck fist fuck Don't think you're having all the fun You know me I hate everyone (Nine Inch Nails, Wish)