Skip to content

Commit 80e7924

Browse files
CORS
1 parent a08ab39 commit 80e7924

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

file_controller.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ std::string genTree(const HttpRequestPtr &req, std::function<void(const HttpResp
2727
{
2828
char *pathvar;
2929
pathvar = getenv("PWD");
30-
std::string result = shell_commons(("cd "+std::string(pathvar)+"/../root " + "&&"+"tree -J" ).c_str()) ;
30+
std::string result = shell_commons(("cd "+std::string(pathvar)+"/.. " + "&&"+"tree -J root" ).c_str()) ;
3131
std::cout << result << std::endl;
3232
auto res = HttpResponse::newHttpResponse();
33+
res->addHeader("Access-Control-Allow-Origin", "*");
3334
res ->setBody(result);
3435
callback(res);
3536
return result;

0 commit comments

Comments
 (0)