Fossil SCM
Make sure the HTTP really was a POST before logging a "POST from different origin" warning.
Commit
2069259e583c533b7b63230c07bbae486b64ac3ea027aab6bfc15fb64ee608c7
Parent
42d73f2aafeaf46…
1 file changed
+1
-1
+1
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -714,11 +714,11 @@ | ||
| 714 | 714 | }else if( zRef[nBase]!=0 && zRef[nBase]!='/' ){ |
| 715 | 715 | rc = 0; |
| 716 | 716 | }else{ |
| 717 | 717 | rc = 1; |
| 718 | 718 | } |
| 719 | - if( rc==0 && bErrorLog ){ | |
| 719 | + if( rc==0 && bErrorLog && fossil_strcmp(P("REQUST_METHOD"),"POST")==0 ){ | |
| 720 | 720 | fossil_errorlog("warning: POST from different origin"); |
| 721 | 721 | } |
| 722 | 722 | fossil_free(zToFree); |
| 723 | 723 | return rc; |
| 724 | 724 | } |
| 725 | 725 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -714,11 +714,11 @@ | |
| 714 | }else if( zRef[nBase]!=0 && zRef[nBase]!='/' ){ |
| 715 | rc = 0; |
| 716 | }else{ |
| 717 | rc = 1; |
| 718 | } |
| 719 | if( rc==0 && bErrorLog ){ |
| 720 | fossil_errorlog("warning: POST from different origin"); |
| 721 | } |
| 722 | fossil_free(zToFree); |
| 723 | return rc; |
| 724 | } |
| 725 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -714,11 +714,11 @@ | |
| 714 | }else if( zRef[nBase]!=0 && zRef[nBase]!='/' ){ |
| 715 | rc = 0; |
| 716 | }else{ |
| 717 | rc = 1; |
| 718 | } |
| 719 | if( rc==0 && bErrorLog && fossil_strcmp(P("REQUST_METHOD"),"POST")==0 ){ |
| 720 | fossil_errorlog("warning: POST from different origin"); |
| 721 | } |
| 722 | fossil_free(zToFree); |
| 723 | return rc; |
| 724 | } |
| 725 |