Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct <base ...> parsing and do not turn a form's GET into POST #93

Merged
merged 2 commits into from
Aug 27, 2017

Conversation

mackyle
Copy link
Contributor

@mackyle mackyle commented Aug 23, 2017

The commit comments have detailed information.

Non-absolute-URI values were not being handled properly.
A <form method="GET"> was incorrectly being turned into a "POST" in some cases.

When a server makes use of the PATH_INFO feature in a CGI,
the returned pages may often have a <base href="..." /> tag
specifying the URL of the CGI itself as the base.

However, to avoid hard-coding the scheme and host into such
a base href, the href value will often omit the scheme, host
and port.

Make sure that when parsing any such base href value that
any omitted components are taken from the current URL rather
than taken as being from a bare, absolute file:/// URL.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
When encountering a <form ...> tag that contains these values:

    method="get" enctype="multipart/form-data"

Do not transform the method into POST to accomodate enctype.

Instead behave in the compatible way that all other browsers
behave in this instance and ignore the enctype parameter
(treating it as the default application/x-www-form-urlencoded)
and perform a "GET" just as the method parameter requests.

This behavior produces far more compatible results than
gratuitously changing the "get" into a "post" which can
result in unexpected "405 Method Not Allowed" errors.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
@tats tats merged commit 455224b into tats:master Aug 27, 2017
@tats
Copy link
Owner

tats commented Aug 27, 2017

Merged, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants