{"action":"opened","issue":{"url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/686","repository_url":"https://api.github.com/repos/openresty/lua-nginx-module","labels_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/686/labels{/name}","comments_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/686/comments","events_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/686/events","html_url":"https://github.com/openresty/lua-nginx-module/issues/686","id":136273126,"number":686,"title":"ngx.unescape_uri() incorrectly decodes %2B","user":{"login":"pirogoeth","id":472488,"avatar_url":"https://avatars.githubusercontent.com/u/472488?v=3","gravatar_id":"","url":"https://api.github.com/users/pirogoeth","html_url":"https://github.com/pirogoeth","followers_url":"https://api.github.com/users/pirogoeth/followers","following_url":"https://api.github.com/users/pirogoeth/following{/other_user}","gists_url":"https://api.github.com/users/pirogoeth/gists{/gist_id}","starred_url":"https://api.github.com/users/pirogoeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pirogoeth/subscriptions","organizations_url":"https://api.github.com/users/pirogoeth/orgs","repos_url":"https://api.github.com/users/pirogoeth/repos","events_url":"https://api.github.com/users/pirogoeth/events{/privacy}","received_events_url":"https://api.github.com/users/pirogoeth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-25T04:05:24Z","updated_at":"2016-02-25T04:05:24Z","closed_at":null,"body":"When URI unescaping data passed in via a SAMLResponse, I noticed that the data is not correctly decoded.\r\n\r\nWhat I got from `ngx.unescape_uri()`:\r\n```\r\nfZFdT4MwFIb/Cun9aKkbm80gwe3CJVPJQC 8MR2cjSbQYk/x49/LQM28cDdNk74f5zxdomzqViSdq/QOXjtA5300tUYxPESks1oYiQqFlg2gcIXIkrut4D4TrTXOFKYmXoII1imjV0Zj14DNwL6pAh5324hUzrUoKMXWd30 VmrvG3ukWX/Zmxpc5SMaeorlNH3IcuKte53S8pR45kfjN1L1B1BVtoOB7qBUFgpHvM06Ii LOTBgh6sFhIuiADYPS364PszYdQAynPJehtjBRqOT2kWEsyCcMD7hs5xxMQ0Emz4TL/1e7EbpUunjZQr7UYTiNs/TyTj/E1gcZu8FJF6eWIqh2J7RvRwrf5CS D A Atwgu2SnrWMla2472M369TUqvj0kro27ysL0kFEAkLj0fL39 Mv\r\n```\r\n\r\nWhat I expected to see:\r\n```\r\nfZFdT4MwFIb/Cun9aKkbm80gwe3CJVPJQC+8MR2cjSbQYk/x49/LQM28cDdNk74f5zxdomzqViSdq/QOXjtA5300tUYxPESks1oYiQqFlg2gcIXIkrut4D4TrTXOFKYmXoII1imjV0Zj14DNwL6pAh5324hUzrUoKMXWd30+VmrvG3ukWX/Zmxpc5SMaeorlNH3IcuKte53S8pR45kfjN1L1B1BVtoOB7qBUFgpHvM06Ii+LOTBgh6sFhIuiADYPS364PszYdQAynPJehtjBRqOT2kWEsyCcMD7hs5xxMQ0Emz4TL/1e7EbpUunjZQr7UYTiNs/TyTj/E1gcZu8FJF6eWIqh2J7RvRwrf5CS+D+A+Atwgu2SnrWMla2472M369TUqvj0kro27ysL0kFEAkLj0fL39+Mv\r\n```\r\n\r\nData that was passed in:\r\n```\r\nfZFdT4MwFIb%2FCun9aKkbm80gwe3CJVPJQC%2B8MR2cjSbQYk%2Fx49%2FLQM28cDdNk74f5zxdomzqViSdq%2FQOXjtA5300tUYxPESks1oYiQqFlg2gcIXIkrut4D4TrTXOFKYmXoII1imjV0Zj14DNwL6pAh5324hUzrUoKMXWd30%2BVmrvG3ukWX%2FZmxpc5SMaeorlNH3IcuKte53S8pR45kfjN1L1B1BVtoOB7qBUFgpHvM06Ii%2BLOTBgh6sFhIuiADYPS364PszYdQAynPJehtjBRqOT2kWEsyCcMD7hs5xxMQ0Emz4TL%2F1e7EbpUunjZQr7UYTiNs%2FTyTj%2FE1gcZu8FJF6eWIqh2J7RvRwrf5CS%2BD%2BA%2BAtwgu2SnrWMla2472M369TUqvj0kro27ysL0kFEAkLj0fL39%2BMv\r\n```\r\n\r\nIt looks like %2B may be getting replaced by +, but then the + gets replaced by a space...\r\n\r\n---------------------------------------------\r\n\r\nOutput of `nginx -V`:\r\n```\r\nnginx version: nginx/1.8.1\r\nbuilt with OpenSSL 1.0.1l-freebsd 15 Jan 2015\r\nTLS SNI support enabled\r\nconfigure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-debug --with-ipv6 --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --add-module=/usr/ports/www/nginx/work/nginx-accesskey-2.0.3 --add-module=/usr/ports/www/nginx/work/nginx-http-auth-digest-bd1c86a --add-module=/usr/ports/www/nginx/work/nginx-auth-ldap-be8ff8eecb --add-module=/usr/ports/www/nginx/work/ngx_http_auth_pam_module-1.2 --with-http_auth_request_module --add-module=/usr/ports/www/nginx/work/ngx_cache_purge-2.3 --add-module=/usr/ports/www/nginx/work/ngx-fancyindex-0.3.5 --with-http_gzip_static_module --add-module=/usr/ports/www/nginx/work/nginx_mod_h264_streaming-2.2.7 --add-module=/usr/ports/www/nginx/work/nchan-0.98 --add-module=/usr/ports/www/nginx/work/nginx-push-stream-module-0.5.1 --with-http_realip_module --add-module=/usr/ports/www/nginx/work/ngx_http_redis-0.3.7 --add-module=/usr/ports/www/nginx/work/ngx_http_response-0.3 --with-http_secure_link_module --with-http_stub_status_module --with-http_sub_module --add-module=/usr/ports/www/nginx/work/nginx-upload-module-aba1e3f34c --add-module=/usr/ports/www/nginx/work/nginx-upload-progress-module-0.9.0 --add-module=/usr/ports/www/nginx/work/mod_zip-1.1.6 --add-module=/usr/ports/www/nginx/work/ngx_devel_kit-0.2.19 --add-module=/usr/ports/www/nginx/work/encrypted-session-nginx-module-0.03 --add-module=/usr/ports/www/nginx/work/lua-nginx-module-0.10.0 --with-pcre --add-module=/usr/ports/www/nginx/work/redis2-nginx-module-0.12 --add-module=/usr/ports/www/nginx/work/nginx-statsd-b756a12 --add-module=/usr/ports/www/nginx/work/nginx_udplog_module-1.0.0 --with-http_spdy_module --with-threads --with-http_ssl_module --add-module=/usr/ports/www/nginx/work/array-var-nginx-module-0.03 --add-module=/usr/ports/www/nginx/work/form-input-nginx-module-0.07 --add-module=/usr/ports/www/nginx/work/iconv-nginx-module-0.10\r\n```"}}