mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 19:03:01 +01:00
fix: delete file request
This commit is contained in:
parent
3f49b5a4ab
commit
70fea6c6b6
2 changed files with 4 additions and 7 deletions
|
@ -491,7 +491,7 @@ Use `BOUNDARY' to separate files. This is sent to Khoj server as a POST request.
|
||||||
(file-name (encode-coding-string file-to-index 'utf-8)))
|
(file-name (encode-coding-string file-to-index 'utf-8)))
|
||||||
(insert (format "--%s\r\n" boundary))
|
(insert (format "--%s\r\n" boundary))
|
||||||
(insert (format "Content-Disposition: form-data; name=\"files\"; filename=\"%s\"\r\n" file-name))
|
(insert (format "Content-Disposition: form-data; name=\"files\"; filename=\"%s\"\r\n" file-name))
|
||||||
(insert "Content-Type: %s\r\n\r\n" content-type)
|
(insert (format "Content-Type: %s\r\n\r\n" content-type))
|
||||||
(insert "")
|
(insert "")
|
||||||
(insert "\r\n")))
|
(insert "\r\n")))
|
||||||
(insert (format "--%s--\r\n" boundary))
|
(insert (format "--%s--\r\n" boundary))
|
||||||
|
|
|
@ -244,19 +244,16 @@ Rule everything\n\n\r\n\
|
||||||
(progn
|
(progn
|
||||||
(should
|
(should
|
||||||
(equal
|
(equal
|
||||||
(khoj--render-update-files-as-request-body (list upgrade-file act-file "/tmp/deleted-file.org") "khoj")
|
(khoj--render-delete-files-as-request-body (list upgrade-file act-file "/tmp/deleted-file.org") "khoj")
|
||||||
(format
|
(format
|
||||||
"\n--khoj\r\n\
|
"\n--khoj\r\n\
|
||||||
Content-Disposition: form-data; name=\"files\"; filename=\"%s\"\r\n\
|
Content-Disposition: form-data; name=\"files\"; filename=\"%s\"\r\n\
|
||||||
Content-Type: text/org\r\n\r\n\
|
Content-Type: text/org\r\n\r\n\
|
||||||
# Become God\n\
|
\r
|
||||||
## Upgrade\n\n\
|
|
||||||
Penance to Immortality\n\n\r
|
|
||||||
--khoj\r\n\
|
--khoj\r\n\
|
||||||
Content-Disposition: form-data; name=\"files\"; filename=\"%s\"\r\n\
|
Content-Disposition: form-data; name=\"files\"; filename=\"%s\"\r\n\
|
||||||
Content-Type: text/org\r\n\r\n\
|
Content-Type: text/org\r\n\r\n\
|
||||||
## Act\n\n\
|
\r
|
||||||
Rule everything\n\n\r
|
|
||||||
--khoj\r\n\
|
--khoj\r\n\
|
||||||
Content-Disposition: form-data; name=\"files\"; filename=\"%s\"\r\n\
|
Content-Disposition: form-data; name=\"files\"; filename=\"%s\"\r\n\
|
||||||
Content-Type: text/org\r\n\r\n\
|
Content-Type: text/org\r\n\r\n\
|
||||||
|
|
Loading…
Reference in a new issue