File extension lookup table - advice needed
Mike G
Posts: 2,702
This is for a Spinneret web server project. The client requests a file resource via HTTP. It could be .htm, gif, whatever. In the response, I send back the proper content-type header. Currently, the logic is wrapped in a bunch of SPIN < if string1 == string2 …elseif…> logic blocks. I want to replace the IF blocks.
I started looking at a hash table but I would need 26^3 rows for 3 lowercase alpha characters. I only need around 30ish rows. I would like to do the same kind of look-up table method for HTTP response codes like “200 OK”.
If someone can point me in the right direction, that would be much appreciated.
I started looking at a hash table but I would need 26^3 rows for 3 lowercase alpha characters. I only need around 30ish rows. I would like to do the same kind of look-up table method for HTTP response codes like “200 OK”.
If someone can point me in the right direction, that would be much appreciated.
Comments
-Phil
Thanks for your input!