[mailto:firstname.lastname@example.org] On Behalf Of Stuart B.
Subject: New webserver
Im designing a webserver as my first project on Ruby
I need help with this line
If you want to write a http server, read the http specification and go
from there. Trying to sanitise a url with regexs WILL leave you with
security holes. If you’re writing anything for which there’s a
specification, read the specification carefully and implement
(preferably test-first) from that. The specification writers are much
smarter than you, and will have thought of many things that you will not
think of until it’s too late.
Regexs are GREAT for all sorts of string manipulation tasks, but they’re
the wrong tool for parsing even a mildly complex language. Parse the
input using a proper parser.
That said, as long as you never, ever plan on exposing this thing to the
public internet, have fun learning.