"CR must be followed by LF" error message

Discussion in 'ASP.NET / ASP.NET Core' started by abodineau, Jan 27, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,

    Since last Saturday I've received this following error message from time to time:
    'The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF'

    The webpage which generates this error has not been modified for months (ie the asp.net code has not changed). In fact nothing has changed on my website for a while. The weird thing is that it seems to work from time to time so it's almost impossible to replicate the problem.

    The webpage in question sends an email. Do you think that's related? I use the VbNewLine constant in the body of the email.
     
  2. Thanks for this. I'm not sure I want to useUnsafeHeaderParsing to true in the config file (as mentionned in that MSDN thread). I will try using vbCrLf instead of VbNewLine to see if it makes any difference. In theory they are identical.
     
  3. Bruce

    Bruce DiscountASP.NET Staff

  4. Well, I've just received this error message again even if my code (which I changed yesterday) now uses vbCrLf (instead of VbNewLine). Any ideas? It has started affecting my users and I really don't know what to do. This code has been in production for about 18 months and it was running fine until last week when it started producing this error from time to time.
     
  5. Have you tried trimming it or adding another? May sound crazy but does help at times.
    i.e. & vbCrLf &
     
  6. I haven't. I'll try that and see how it goes. Thanks.
     
  7. Thanks Bruce but as mentionned in my original post, I was using vbNewLine which is the equivalent of vbCRLF as far as I know. The main thing is that itused to work fine. Without changing anything at all, it has started to produce this error from time to time which means it's almost impossible to replicate it. I've changed my code so that is uses vbCrLb instead of vbNewLine. Will see how it goes.
    Thanks.
     
  8. From the page in question, I'm using PayPal Instant Notification (https://www.paypal.com/cgi-bin/webscr). Again this has worked for months without any problems. Anyway, I've modified this particular piece of code and will see how it goes. The thing is as it only fails from time to time, I cannot be sure if it's fixed or not.
     
  9. Are you calling any kind of web service from your application?

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page