Browse Source

Improve pastebin example

Reject more malicious paths.
Adam Cammack 12 years ago
parent
commit
a9294e0f50
1 changed files with 1 additions and 0 deletions
  1. 1 0
      examples/rest_pastebin/src/toppage_handler.erl

+ 1 - 0
examples/rest_pastebin/src/toppage_handler.erl

@@ -89,6 +89,7 @@ file_exists(Name) ->
 
 valid_path(<<>>) -> true;
 valid_path(<<$., _T/binary>>) -> false;
+valid_path(<<$/, _T/binary>>) -> false;
 valid_path(<<_Char, T/binary>>) -> valid_path(T).
 
 new_paste_id() ->