Changeset 1276
- Timestamp:
- 02/09/08 23:36:07
- Files:
-
- HTTP/HTTP.lua (modified) (1 diff)
- HTTP/MIME.lua (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
HTTP/HTTP.lua
r1272 r1276 189 189 if aType:lower():find( 'multipart/form-data', 1, true ) then 190 190 local MIME = require( 'MIME' ) 191 local aContent = 'content-type: ' .. aType .. '\ n\n' .. ( aRequest.content or '' )191 local aContent = 'content-type: ' .. aType .. '\r\n\r\n' .. ( aRequest.content or '' ) 192 192 local aMIME = MIME( aContent ) 193 193 HTTP/MIME.lua
r1047 r1276 301 301 302 302 if anEnd then 303 aStart = aValue:find( '\ n', aStart, true ) + 1303 aStart = aValue:find( '\r\n', aStart, true ) + 2 304 304 305 aMultipart[ #aMultipart + 1 ] = MIME( aValue:sub( aStart, anEnd - 2) )305 aMultipart[ #aMultipart + 1 ] = MIME( aValue:sub( aStart, anEnd - 3 ) ) 306 306 else 307 307 break … … 396 396 local aHeaderParameter = ReadParameter( aValue ) 397 397 local aHeader = { key = aHeaderKey, value = aHeaderValue, parameter = aHeaderParameter } 398 398 399 399 return aHeader 400 400 end … … 452 452 453 453 while true do 454 anEnd = aValue:find( '\ n', aStart, true )454 anEnd = aValue:find( '\r\n', aStart, true ) 455 455 456 456 if anEnd then 457 457 local aLine = aValue:sub( aStart, anEnd - 1 ) 458 458 459 anEnd = anEnd + 1459 anEnd = anEnd + 2 460 460 aStart = anEnd 461 461 … … 545 545 local self = setmetatable( _M, {} ) 546 546 local meta = getmetatable( self ) 547 548 local function Normalize( aValue )549 return ( aValue:gsub( '(\r\n)', '\n' ):gsub( '(\r)', '\n' ) )550 end551 547 552 548 local function Capitalize( aValue ) … … 590 586 591 587 local function ReadMIME( aValue ) 592 local aValue = Normalize( aValue )593 588 local MIMEHeaders = require( 'MIMEHeaders' ) 594 589 local aHeader, anEnd = MIMEHeaders( aValue )