| 807 | |
| 808 | |
| 809 | Future<http::Response> FilesProcess::debug( |
| 810 | const http::Request& request, |
| 811 | const Option<Principal>& principal) |
| 812 | { |
| 813 | JSON::Object object; |
| 814 | foreachpair (const string& virtualPath, const string& path, paths) { |
| 815 | object.values[virtualPath] = path; |
| 816 | } |
| 817 | |
| 818 | const Option<string>& jsonp = request.url.query.get("jsonp"); |
| 819 | |
| 820 | return authorizeEndpoint( |
| 821 | request.url.path, |
| 822 | request.method, |
| 823 | authorizer, |
| 824 | principal) |
| 825 | .then(defer( |
| 826 | [object, jsonp](bool authorized) -> Future<http::Response> { |
| 827 | if (!authorized) { |
| 828 | return Forbidden(); |
| 829 | } |
| 830 | |
| 831 | return OK(object, jsonp); |
| 832 | })); |
| 833 | } |
| 834 | |
| 835 | |
| 836 | Result<string> FilesProcess::resolve(const string& path) |