diff --git a/api/api.go b/api/api.go index f69b1764a..993803eaa 100644 --- a/api/api.go +++ b/api/api.go @@ -38,6 +38,7 @@ type PayloadSubmission struct { // from the x-api, but it is also used when restoring earlier iterations. func Fetch(url string) ([]*Problem, error) { req, err := http.NewRequest("GET", url, nil) + fmt.Println(url) if err != nil { return nil, err } diff --git a/handlers/submit.go b/handlers/submit.go index e2080140c..cf0e514e2 100644 --- a/handlers/submit.go +++ b/handlers/submit.go @@ -41,6 +41,11 @@ func Submit(ctx *cli.Context) { log.Fatal(err) } + dir, err := filepath.EvalSymlinks(c.Dir) + if err != nil { + log.Fatal(err) + } + code, err := ioutil.ReadFile(path) if err != nil { log.Fatalf("Cannot read the contents of %s - %s\n", filename, err) @@ -51,7 +56,7 @@ func Submit(ctx *cli.Context) { iteration := &api.Iteration{ Key: c.APIKey, Code: string(code), - Path: path[len(c.Dir):], + Path: path[len(dir):], Dir: c.Dir, }