Closed markusatm closed 2 years ago
@jmillan?
Can you please add the corresponding test in test/test-parser.js
?
BTW, thanks for the PR @markusatm and sorry for the delay.
Once with the test we'll be able to merge it.
Hi @jmillan, I've added a test for status line parsing as there wasn't yet one.
Though I'm not sure if that was what you wanted as I hadn't changed anything in the parser itself. My change is to ensure that the string which is handed to the status line parser really only consists of one line.
I observed failures to parse the body of a refer NOTIFY in JsSIP if the body contained more than just a status line. According to RFC 3515 section 2.4.5 it is allowed for additional SIP headers to be in the NOTIFY body in addition to the status line. In accordance with that I changed the JsSIP code so the Status_Line parser is only used to parse the first line of the NOTIFY body, which according to the RFC always contains the status line. Thus the parser will no longer throw an error if there is additional data in the body after the status line.
For reference, this is the NOTIFY body that was received: