mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 08:32:50 -06:00
sync with the changes in http-slim
This commit is contained in:
@@ -71,10 +71,7 @@ pgfMain cache env rq =
|
|||||||
return (Response
|
return (Response
|
||||||
{ rspCode = 200
|
{ rspCode = 200
|
||||||
, rspReason = "OK"
|
, rspReason = "OK"
|
||||||
, rspHeaders = [Header HdrServer defaultServer
|
, rspHeaders = [Header HdrContentType "application/pgf"]
|
||||||
,Header HdrContentType "application/pgf"
|
|
||||||
,Header HdrContentLength (show (length body))
|
|
||||||
]
|
|
||||||
, rspBody = body
|
, rspBody = body
|
||||||
})
|
})
|
||||||
| otherwise -> httpError 415 "Only .pgf files can be downloaded" ""
|
| otherwise -> httpError 415 "Only .pgf files can be downloaded" ""
|
||||||
@@ -159,12 +156,10 @@ pgfCommand qsem command q (t,pgf) =
|
|||||||
|
|
||||||
-- Without caching parse results:
|
-- Without caching parse results:
|
||||||
parse' cat start mlimit ((from,concr),input) =
|
parse' cat start mlimit ((from,concr),input) =
|
||||||
case parseWithHeuristics concr cat input (-1) callbacks of
|
case PGF2.parse concr cat (init input) of
|
||||||
ParseOk ts -> return (Right (maybe id take mlimit (drop start ts)))
|
ParseOk ts -> return (Right (maybe id take mlimit (drop start ts)))
|
||||||
ParseFailed _ tok -> return (Left tok)
|
ParseFailed _ tok -> return (Left tok)
|
||||||
ParseIncomplete -> return (Left "")
|
ParseIncomplete -> return (Left "")
|
||||||
where
|
|
||||||
callbacks = undefined
|
|
||||||
|
|
||||||
parseToChart ((from,concr),input) cat mlimit = undefined {-
|
parseToChart ((from,concr),input) cat mlimit = undefined {-
|
||||||
do r <- case C.parseToChart concr cat input (-1) callbacks (fromMaybe 5 mlimit) of
|
do r <- case C.parseToChart concr cat input (-1) callbacks (fromMaybe 5 mlimit) of
|
||||||
@@ -343,10 +338,7 @@ pgfCommand qsem command q (t,pgf) =
|
|||||||
return (Response
|
return (Response
|
||||||
{ rspCode = 200
|
{ rspCode = 200
|
||||||
, rspReason = "OK"
|
, rspReason = "OK"
|
||||||
, rspHeaders = [Header HdrServer defaultServer
|
, rspHeaders = [Header HdrContentType mimeType]
|
||||||
,Header HdrContentType mimeType
|
|
||||||
,Header HdrContentLength (show (length body))
|
|
||||||
]
|
|
||||||
, rspBody = body
|
, rspBody = body
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -367,10 +359,8 @@ out q t r = do
|
|||||||
return (Response
|
return (Response
|
||||||
{ rspCode = 200
|
{ rspCode = 200
|
||||||
, rspReason = "OK"
|
, rspReason = "OK"
|
||||||
, rspHeaders = [Header HdrServer defaultServer
|
, rspHeaders = [Header HdrContentType ("application/"++ty++"; charset=utf-8")
|
||||||
,Header HdrContentType ("application/"++ty++"; charset=utf-8")
|
|
||||||
,Header HdrLastModified fmt
|
,Header HdrLastModified fmt
|
||||||
,Header HdrContentLength (show (length str))
|
|
||||||
]
|
]
|
||||||
, rspBody = str
|
, rspBody = str
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user