tkf / emacs-request

Request.el -- Easy HTTP request for Emacs Lisp
http://tkf.github.com/emacs-request/
GNU General Public License v3.0
629 stars 93 forks source link

testserver.py: redirect to correct path #179

Closed jktomer closed 4 years ago

jktomer commented 4 years ago

The /redirect handler on the test Flask server is meant to redirect /redirect/foo/bar to /foo/bar, and the tests expect that behavior (for example, request-get-simple-redirection assumes a chain of /redirect/redirect/report/some-path -> /redirect/report/some-path -> /report/some-path).

Instead, /redirect/foo/bar actually redirects to /redirect/foo/bar/foo/bar, because the /redirect handler returns redirect(path), and Werkzeug's response wrapper resolves non-absolute Location headers relative to the incoming request's full URL.

This change prepends a "/" to the paramter to redirect(), casuing Werkzeug to fix the Location header as intended, and fixing request-get-simple-redirection.

dickmao commented 4 years ago

Great.