kiddin9 / openwrt-packages

openwrt packages
GNU General Public License v2.0
1.64k stars 593 forks source link

Fix /cgi-bin/ permanent redirect breaking POST requests #46

Closed NewbieOrange closed 2 years ago

NewbieOrange commented 2 years ago

nginx/uci.conf rewrites /cgi-bin/* using 302 moved permanently, which will break POST requests (casuing browsers to use GET instead of POST) thus break scripts sending non-GET requests to /cgi-bin/ endpoints (e.g. linkease/istore).

This patch fixes the issue, and istore has been tested working correctly.

kiddin9 commented 2 years ago

Thanks.

NewbieOrange commented 2 years ago

@kiddin9 forgot to mention that you also need to patch /etc/config/nginx and remove following lines from both _lan and _ssl.

    list rewrite '"^/$" $scheme://$http_host/luci/ permanent'
    list rewrite '"^/cgi-bin/(.*)" $scheme://$http_host/$1 permanent'