File tree Expand file tree Collapse file tree 1 file changed +8
-18
lines changed
lsp/src/Language/LSP/Server Expand file tree Collapse file tree 1 file changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -187,30 +187,20 @@ ioLoop ioLogger logger clientIn serverDefinition vfs sendMsg = do
187
187
go (parse parser remainder)
188
188
189
189
parser = do
190
- _ <- string " Content-"
191
- len <- lengthFirst <|> typeFirst
192
- Attoparsec. take len
193
-
194
- lengthFirst = do
195
- len <- headLength
190
+ try contentType <|> (return () )
191
+ len <- contentLength
192
+ try contentType <|> (return () )
196
193
_ <- string _ONE_CRLF
197
- <|> (headType >> string _ONE_CRLF)
198
- return len
199
-
200
- typeFirst = do
201
- _ <- headType
202
- _ <- string " Content-"
203
- len <- headLength
204
- _ <- string _ONE_CRLF
205
- return len
194
+ Attoparsec. take len
206
195
207
- headLength = do
208
- _ <- string " Length: "
196
+ contentLength = do
197
+ _ <- string " Content- Length: "
209
198
len <- decimal
210
199
_ <- string _ONE_CRLF
211
200
return len
212
201
213
- headType = do
202
+ contentType = do
203
+ _ <- string " Content-Type: "
214
204
skipWhile (/= ' \r ' )
215
205
_ <- string _ONE_CRLF
216
206
return ()
You can’t perform that action at this time.
0 commit comments