Software / code / prosody
Comparison
plugins/mod_http_file_share.lua @ 12722:cd993fd7b60d
mod_http_file_share: Use correct variable name (thanks riau.sni)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 04 Sep 2022 10:01:57 +0100 |
| parent | 12708:9953ac7b0c15 |
| child | 12977:74b9e05af71e |
comparison
equal
deleted
inserted
replaced
| 12721:7830db3c38c3 | 12722:cd993fd7b60d |
|---|---|
| 262 local authed, authed_upload_info = verify_jwt(authz); | 262 local authed, authed_upload_info = verify_jwt(authz); |
| 263 if not authed then | 263 if not authed then |
| 264 module:log("debug", "Unauthorized or invalid token: %s, %q", authz, authed_upload_info); | 264 module:log("debug", "Unauthorized or invalid token: %s, %q", authz, authed_upload_info); |
| 265 return 401; | 265 return 401; |
| 266 end | 266 end |
| 267 if not path or upload_info.slot ~= path:match("^[^/]+") then | 267 if not path or authed_upload_info.slot ~= path:match("^[^/]+") then |
| 268 module:log("debug", "Invalid upload slot: %q, path: %q", upload_info.slot, path); | 268 module:log("debug", "Invalid upload slot: %q, path: %q", authed_upload_info.slot, path); |
| 269 return 400; | 269 return 400; |
| 270 end | 270 end |
| 271 if request.headers.content_length and tonumber(request.headers.content_length) ~= upload_info.filesize then | 271 if request.headers.content_length and tonumber(request.headers.content_length) ~= authed_upload_info.filesize then |
| 272 return 413; | 272 return 413; |
| 273 -- Note: We don't know the size if the upload is streamed in chunked encoding, | 273 -- Note: We don't know the size if the upload is streamed in chunked encoding, |
| 274 -- so we also check the final file size on completion. | 274 -- so we also check the final file size on completion. |
| 275 end | 275 end |
| 276 upload_info = authed_upload_info; | 276 upload_info = authed_upload_info; |