Skip to content

Commit 5ec951f

Browse files
authored
Merge pull request #12 from dmandalidis/fix-readme
Remove mention of multipart/form-data (fixes #11)
2 parents 55f286f + 6c0c236 commit 5ec951f

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ Flow-wise, Clammit is straightforward. It sets up an HTTP server to accept
110110
incoming requests (main.go):
111111

112112
1. Each request is passed to the forwarder (forwarder/forwarder.go)
113-
2. The forwarder dowloads the request body (as it will be used at least twice)
113+
2. The forwarder downloads the request body (as it will be used at least twice)
114114
3. The forwarder passes the request to the clam interceptor (clam\_interceptor.go)
115-
4. The only request that will be tested will have methods POST/PUT/PATCH and content-type "multipart/form-data"
115+
4. The only request that will be tested will have methods POST/PUT/PATCH
116116
5. The clam interceptor locates and sends each form-data field to ClamD
117117
6. For any positive response, the interceptor will write an HTTP response and return (and the forwarder will not attempt to forward the request)
118118
7. If the interceptor OKs the request, the forwarder constructs a new HTTP request and forwards to the application
@@ -170,9 +170,8 @@ This method will return JSON giving the current status of Clammit and its connec
170170
POST /clammit/scan
171171
```
172172

173-
This is the endpoint to submit files for scanning only. The request must have content-type ```multipart/form-data```
174-
and any files to be scanned should be attached as file objects. Clammit will return an HTTP status code of 200 if
175-
the request is clean and 418 if there is a bad attachment.
173+
This is the endpoint to submit files for scanning only. Any files to be scanned should be attached as file objects.
174+
Clammit will return an HTTP status code of 200 if the request is clean and 418 if there is a bad attachment.
176175

177176
### Test
178177

@@ -181,7 +180,7 @@ the request is clean and 418 if there is a bad attachment.
181180
```
182181

183182
This will return a simple file upload page, to test sending requests to Clammit. These pages are located in the
184-
testing/ subdirectory.
183+
testing/ sub-directory.
185184

186185
## Resources
187186

@@ -197,7 +196,7 @@ Run ```make test```
197196
* It does not attempt to recursively scan fields - e.g. attachments in an email chain
198197
* It does not try to be particularly clever with storing the body, which means that a DOS attack by hitting it simultaneously with a gazillion small files is quite possible.
199198

200-
## Licence
199+
## License
201200

202201
[MIT](https://github.com/ifad/clammit/blob/master/LICENSE)
203202

src/clammit/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/*
2-
* The Clammit application intercepts HTTP POST requests with content-type
3-
* "multipart/form-data", forwards any "file" form-data elements to ClamAV
4-
* and only forwards the request to the application if ClamAV passes all
5-
* of these elements as virus-free.
2+
* The Clammit application intercepts HTTP POST/PATCH/PUT requests, forwards any
3+
* "file" form-data elements to ClamAV and only forwards the request to the
4+
* application if ClamAV passes all of these elements as virus-free.
65
*/
76
package main
87

0 commit comments

Comments
 (0)