Mercurial > urweb
comparison src/compiler.sml @ 2139:8c81cd351c1a
Allow URIs specified in file directives implicitly
It seems to me that, by specifying that one wants to serve a given
file at a specified URI, one is implying that this URI should be
allowed.
author | Julian Squires <julian@cipht.net> |
---|---|
date | Fri, 24 Apr 2015 16:21:55 -0400 |
parents | c15f35e507b5 |
children | fb113569519e 2b1af5dc6dee |
comparison
equal
deleted
inserted
replaced
2138:3ca67d73fa5d | 2139:8c81cd351c1a |
---|---|
873 | 873 |
874 | "file" => | 874 | "file" => |
875 (case String.fields Char.isSpace arg of | 875 (case String.fields Char.isSpace arg of |
876 [uri, fname] => (Settings.setFilePath thisPath; | 876 [uri, fname] => (Settings.setFilePath thisPath; |
877 Settings.addFile {Uri = uri, | 877 Settings.addFile {Uri = uri, |
878 LoadFromFilename = fname}) | 878 LoadFromFilename = fname}; |
879 url := {action = Settings.Allow, kind = Settings.Exact, pattern = uri} :: !url) | |
879 | _ => ErrorMsg.error "Bad 'file' arguments") | 880 | _ => ErrorMsg.error "Bad 'file' arguments") |
880 | 881 |
881 | _ => ErrorMsg.error ("Unrecognized command '" ^ cmd ^ "'"); | 882 | _ => ErrorMsg.error ("Unrecognized command '" ^ cmd ^ "'"); |
882 read () | 883 read () |
883 end | 884 end |