File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -556,6 +556,13 @@ void sioNetwork::sio_set_prefix()
556556
557557 prefixSpec_str = string ((const char *)prefixSpec);
558558 prefixSpec_str = prefixSpec_str.substr (prefixSpec_str.find_first_of (" :" ) + 1 );
559+
560+ // Append trailing slash if not found
561+ if (prefixSpec_str.back () != ' /' )
562+ {
563+ prefixSpec_str += " /" ;
564+ }
565+
559566#ifdef VERBOSE_PROTOCOL
560567 Debug_printf (" sioNetwork::sio_set_prefix(%s)\n " , prefixSpec_str.c_str ());
561568#endif
@@ -568,7 +575,7 @@ void sioNetwork::sio_set_prefix()
568575 else
569576 {
570577 // For the remaining cases, append trailing slash if not found
571- if (prefix[prefix. size ()- 1 ] != ' /' )
578+ if (prefix. back () != ' /' )
572579 {
573580 prefix += " /" ;
574581 }
@@ -600,11 +607,6 @@ void sioNetwork::sio_set_prefix()
600607 else if (prefixSpec_str.find_first_of (" :" ) != string::npos)
601608 {
602609 prefix = prefixSpec_str;
603- // Check for trailing slash. Append if missing.
604- if (prefix[prefix.size ()-1 ] != ' /' )
605- {
606- prefix += " /" ;
607- }
608610 }
609611 else // append to path.
610612 {
You can’t perform that action at this time.
0 commit comments