diff --git a/.gitignore b/.gitignore index 3d96e92..26344d9 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,7 @@ go.work # Executable hibiscus -.idea/ \ No newline at end of file +.idea/ + +# Because currently it's used in "prod" +data/ \ No newline at end of file diff --git a/config/config.txt b/config/config.txt new file mode 100644 index 0000000..ceb3092 --- /dev/null +++ b/config/config.txt @@ -0,0 +1,4 @@ +port=7101 +username=test +password=pass +export_code=hibiscus \ No newline at end of file diff --git a/files.go b/files.go index 3c92e09..02b5e47 100644 --- a/files.go +++ b/files.go @@ -12,7 +12,7 @@ import ( ) func GetFile(filename string, w http.ResponseWriter, r *http.Request) { - path := "data/" + filepath.Base(filename) + ".txt" // This should *theoretically* sanitize the string + path := "data/" + filename + ".txt" // Can we and should we sanitize this? if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) { NotFound(w, r) diff --git a/pages/index.html b/pages/index.html index eb2679d..f4ffe0a 100644 --- a/pages/index.html +++ b/pages/index.html @@ -16,11 +16,11 @@

-
+

-
+