Is https retained on relative form action URLs?

前端 未结 4 1378
忘掉有多难
忘掉有多难 2021-01-18 16:32

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:

<
相关标签:
4条回答
  • 2021-01-18 17:12

    It should retain the https part.

    0 讨论(0)
  • 2021-01-18 17:13

    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.

    0 讨论(0)
  • 2021-01-18 17:20

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

    0 讨论(0)
  • 2021-01-18 17:31

    Yes, because it's a relative path.

    0 讨论(0)
提交回复
热议问题