Re: [patch] httpd: fcgi/PATH_INFO not handled correctly

2015-09-05 Thread Joerg Jung
On Sun, Aug 30, 2015 at 08:40:57PM +0200, Joerg Jung wrote:
> On Wed, Aug 26, 2015 at 08:23:22PM +0200, Denis Fondras wrote:
> > Hello,
> > 
> > While using httpd together uwsgi and Flask, I noticed that GET requests to /
> > returned 404. The same setup with nginx was returning 200.
> > 
> > The culprit is that PATH_INFO is not set when REQUEST_URI is /.
> > The following patch correctly set PATH_INFO in every case.
> 
> Yes, I think your proposed diff is right.
> I would like to see this committed, any dev willing to give OK?

Ping, anyone?

> Thanks,
> Regards,
> Joerg
> 
>  
> > Index: httpd.c
> > ===
> > RCS file: /cvs/src/usr.sbin/httpd/httpd.c,v
> > retrieving revision 1.39
> > diff -u -p -r1.39 httpd.c
> > --- httpd.c 20 Aug 2015 13:00:23 -  1.39
> > +++ httpd.c 26 Aug 2015 18:12:34 -
> > @@ -695,7 +695,7 @@ path_info(char *path)
> >  
> > for (p = end; p > start; p--) {
> > /* Scan every path component from the end and at each '/' */
> > -   if (p < end && *p != '/')
> > +   if (p <= end && *p != '/')
> > continue;
> >  
> > /* Temporarily cut the path component out */
> > 



Re: [patch] httpd: fcgi/PATH_INFO not handled correctly

2015-08-30 Thread Joerg Jung
On Wed, Aug 26, 2015 at 08:23:22PM +0200, Denis Fondras wrote:
 Hello,
 
 While using httpd together uwsgi and Flask, I noticed that GET requests to /
 returned 404. The same setup with nginx was returning 200.
 
 The culprit is that PATH_INFO is not set when REQUEST_URI is /.
 The following patch correctly set PATH_INFO in every case.

Yes, I think your proposed diff is right.
I would like to see this committed, any dev willing to give OK?

Thanks,
Regards,
Joerg

 
 Denis
 
 
 Index: httpd.c
 ===
 RCS file: /cvs/src/usr.sbin/httpd/httpd.c,v
 retrieving revision 1.39
 diff -u -p -r1.39 httpd.c
 --- httpd.c   20 Aug 2015 13:00:23 -  1.39
 +++ httpd.c   26 Aug 2015 18:12:34 -
 @@ -695,7 +695,7 @@ path_info(char *path)
  
   for (p = end; p  start; p--) {
   /* Scan every path component from the end and at each '/' */
 - if (p  end  *p != '/')
 + if (p = end  *p != '/')
   continue;
  
   /* Temporarily cut the path component out */
 



[patch] httpd: fcgi/PATH_INFO not handled correctly

2015-08-26 Thread Denis Fondras
Hello,

While using httpd together uwsgi and Flask, I noticed that GET requests to /
returned 404. The same setup with nginx was returning 200.

The culprit is that PATH_INFO is not set when REQUEST_URI is /.
The following patch correctly set PATH_INFO in every case.

Denis


Index: httpd.c
===
RCS file: /cvs/src/usr.sbin/httpd/httpd.c,v
retrieving revision 1.39
diff -u -p -r1.39 httpd.c
--- httpd.c 20 Aug 2015 13:00:23 -  1.39
+++ httpd.c 26 Aug 2015 18:12:34 -
@@ -695,7 +695,7 @@ path_info(char *path)
 
for (p = end; p  start; p--) {
/* Scan every path component from the end and at each '/' */
-   if (p  end  *p != '/')
+   if (p = end  *p != '/')
continue;
 
/* Temporarily cut the path component out */



Re: [patch] httpd: fcgi/PATH_INFO not handled correctly

2015-08-26 Thread Kyle Thompson
This patch fixes the problem I had previously that I mentioned on the 
Github issues.


Kyle

On 8/26/2015 1:23 PM, Denis Fondras wrote:

Hello,

While using httpd together uwsgi and Flask, I noticed that GET requests to /
returned 404. The same setup with nginx was returning 200.

The culprit is that PATH_INFO is not set when REQUEST_URI is /.
The following patch correctly set PATH_INFO in every case.

Denis


Index: httpd.c
===
RCS file: /cvs/src/usr.sbin/httpd/httpd.c,v
retrieving revision 1.39
diff -u -p -r1.39 httpd.c
--- httpd.c 20 Aug 2015 13:00:23 -  1.39
+++ httpd.c 26 Aug 2015 18:12:34 -
@@ -695,7 +695,7 @@ path_info(char *path)
  
  	for (p = end; p  start; p--) {

/* Scan every path component from the end and at each '/' */
-   if (p  end  *p != '/')
+   if (p = end  *p != '/')
continue;
  
  		/* Temporarily cut the path component out */