Robot
Robot

Reputation: 1065

Is https retained on relative form action URLs?

Consider a page with a form that is visited via https. If the form action has a relative URL to the form page, is the https protocol retained?

Ex: you visit:

https://example.com/cart.html

which contains the form tag:

<form name="form1" method="post" action="SubmitOrder.aspx" id="form1">

Is the form submitted via https or http?

Upvotes: 5

Views: 3070

Answers (4)

Gumbo
Gumbo

Reputation: 655239

In short: Yes, the same URL scheme is used.

In detail: Relative URLs are resolved to absolute ones on the base of the current document’s URL. So if your URL is a https URL and you don’t specify the URL scheme (obviously because otherwise you would have an absolute URL), the resolved URL uses the same URL scheme as the base URL.

Upvotes: 2

Danny Maya
Danny Maya

Reputation: 56

Yes, relative paths always stay. Direct URLs are only needed when switching between http/https or vice versa.

Upvotes: 2

Trevor
Trevor

Reputation: 6689

Yes, because it's a relative path.

Upvotes: 5

DGM
DGM

Reputation: 26979

It should retain the https part.

Upvotes: 1

Related Questions