🧚 A practical web framework for Gleam

Use `./tmp` instead of `./gleam-wisp/` as a fallback tmp directory

authored by DitherWither and committed by Louis Pilfold 7ee54cc7 9d7635a8

Changed files
+4 -2
src
+4 -2
src/wisp/internal.gleam
··· 1 1 import directories 2 2 import gleam/bit_array 3 3 import gleam/crypto 4 - import gleam/result 5 4 import gleam/string 6 5 7 6 // HELPERS ··· 31 30 secret_key_base: String, 32 31 ) -> Connection { 33 32 // Fallback to current working directory when no valid tmp directory exists 34 - let prefix = result.unwrap(directories.tmp_dir(), ".") <> "/gleam-wisp/" 33 + let prefix = case directories.tmp_dir() { 34 + Ok(tmp_dir) -> tmp_dir <> "/gleam-wisp/" 35 + Error(_) -> "./tmp/" 36 + } 35 37 let temporary_directory = join_path(prefix, random_slug()) 36 38 Connection( 37 39 reader: body_reader,