diff options
author | Alexandre Detiste <alexandre.detiste@gmail.com> | 2024-02-12 09:28:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-12 11:28:01 +0300 |
commit | 98be8d9fc1de19ec526cf7bee0d03a1e78262ba8 (patch) | |
tree | c1379f7456de6f543814a766af072480cc525b8d /src | |
parent | fa69770e52ba869feb8339d49e7c3c536953fbde (diff) | |
download | luasocket-98be8d9fc1de19ec526cf7bee0d03a1e78262ba8.tar.gz luasocket-98be8d9fc1de19ec526cf7bee0d03a1e78262ba8.tar.bz2 luasocket-98be8d9fc1de19ec526cf7bee0d03a1e78262ba8.zip |
chore(http): Correct typos in error message and code comments (#423)
Diffstat (limited to 'src')
-rw-r--r-- | src/http.lua | 6 | ||||
-rwxr-xr-x | src/makefile | 2 | ||||
-rw-r--r-- | src/smtp.lua | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/http.lua b/src/http.lua index e93003d..259eb2b 100644 --- a/src/http.lua +++ b/src/http.lua | |||
@@ -54,7 +54,7 @@ local function receiveheaders(sock, headers) | |||
54 | while line ~= "" do | 54 | while line ~= "" do |
55 | -- get field-name and value | 55 | -- get field-name and value |
56 | name, value = socket.skip(2, string.find(line, "^(.-):%s*(.*)")) | 56 | name, value = socket.skip(2, string.find(line, "^(.-):%s*(.*)")) |
57 | if not (name and value) then return nil, "malformed reponse headers" end | 57 | if not (name and value) then return nil, "malformed response headers" end |
58 | name = string.lower(name) | 58 | name = string.lower(name) |
59 | -- get next line (value might be folded) | 59 | -- get next line (value might be folded) |
60 | line, err = sock:receive() | 60 | line, err = sock:receive() |
@@ -81,7 +81,7 @@ socket.sourcet["http-chunked"] = function(sock, headers) | |||
81 | dirty = function() return sock:dirty() end | 81 | dirty = function() return sock:dirty() end |
82 | }, { | 82 | }, { |
83 | __call = function() | 83 | __call = function() |
84 | -- get chunk size, skip extention | 84 | -- get chunk size, skip extension |
85 | local line, err = sock:receive() | 85 | local line, err = sock:receive() |
86 | if err then return nil, err end | 86 | if err then return nil, err end |
87 | local size = base.tonumber(string.gsub(line, ";.*", ""), 16) | 87 | local size = base.tonumber(string.gsub(line, ";.*", ""), 16) |
@@ -281,7 +281,7 @@ local function adjustrequest(reqt) | |||
281 | if not (host and host ~= "") then | 281 | if not (host and host ~= "") then |
282 | socket.try(nil, "invalid host '" .. base.tostring(nreqt.host) .. "'") | 282 | socket.try(nil, "invalid host '" .. base.tostring(nreqt.host) .. "'") |
283 | end | 283 | end |
284 | -- compute uri if user hasn't overriden | 284 | -- compute uri if user hasn't overridden |
285 | nreqt.uri = reqt.uri or adjusturi(nreqt) | 285 | nreqt.uri = reqt.uri or adjusturi(nreqt) |
286 | -- adjust headers in request | 286 | -- adjust headers in request |
287 | nreqt.headers = adjustheaders(nreqt) | 287 | nreqt.headers = adjustheaders(nreqt) |
diff --git a/src/makefile b/src/makefile index dbe328f..25b293c 100755 --- a/src/makefile +++ b/src/makefile | |||
@@ -1,6 +1,6 @@ | |||
1 | # luasocket src/makefile | 1 | # luasocket src/makefile |
2 | # | 2 | # |
3 | # Definitions in this section can be overriden on the command line or in the | 3 | # Definitions in this section can be overridden on the command line or in the |
4 | # environment. | 4 | # environment. |
5 | # | 5 | # |
6 | # These are equivalent: | 6 | # These are equivalent: |
diff --git a/src/smtp.lua b/src/smtp.lua index b113d00..c26ce44 100644 --- a/src/smtp.lua +++ b/src/smtp.lua | |||
@@ -225,7 +225,7 @@ local function adjust_headers(mesgt) | |||
225 | lower["date"] = lower["date"] or | 225 | lower["date"] = lower["date"] or |
226 | os.date("!%a, %d %b %Y %H:%M:%S ") .. (mesgt.zone or _M.ZONE) | 226 | os.date("!%a, %d %b %Y %H:%M:%S ") .. (mesgt.zone or _M.ZONE) |
227 | lower["x-mailer"] = lower["x-mailer"] or socket._VERSION | 227 | lower["x-mailer"] = lower["x-mailer"] or socket._VERSION |
228 | -- this can't be overriden | 228 | -- this can't be overridden |
229 | lower["mime-version"] = "1.0" | 229 | lower["mime-version"] = "1.0" |
230 | return lower | 230 | return lower |
231 | end | 231 | end |
@@ -253,4 +253,4 @@ _M.send = socket.protect(function(mailt) | |||
253 | return s:close() | 253 | return s:close() |
254 | end) | 254 | end) |
255 | 255 | ||
256 | return _M \ No newline at end of file | 256 | return _M |