From 3afa2ee69eeecb6b6c0a250eb6f19cc02ed4947b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=BCller?= Date: Tue, 16 Jun 2020 10:52:33 +0200 Subject: [PATCH] Token ending with LF and no CR are valid --- src/net.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/net.c b/src/net.c index c14953b..3c45f0d 100644 --- a/src/net.c +++ b/src/net.c @@ -1431,12 +1431,12 @@ static int validateAuthToken (str_t s) { if( p==s || c != ':' || p[0] != ' ' ) return 0; s = ++p; - while( (c=*p++) != '\r' && c != 0 ); - if( p==s || c==0 || p[0] != '\n' ) + while( (c=*p++) != '\n' && c != 0 ); + if( p==s || c==0 ) return 0; - if( p[1] == 0 ) + if( p[0] == 0 ) return 1; - s = p = p+1; // next line + s = p; // next line } }