forked from Kong/kong
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing a bug with multipart requests, and closing Kong#202
Former-commit-id: 8c1276c3b6f0b5a9b382bab1df55fdb7532b52e5
- Loading branch information
1 parent
edb9cc4
commit b95197f
Showing
7 changed files
with
62 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
return {} -- No schema | ||
local IO = require "kong.tools.io" | ||
|
||
local function validate_file(value) | ||
local exists = IO.file_exists(value) | ||
if not os.execute("touch "..value) == 0 then | ||
return false, "Cannot create a file in the path specified. Make sure the path is valid, and Kong has the right permissions" | ||
end | ||
|
||
if not exists then | ||
os.remove(value) -- Remove the created file if it didn't exist before | ||
end | ||
|
||
return true | ||
end | ||
|
||
return { | ||
path = { required = true, type = "string", func = validate_file } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters