solidjs / solid-router

A universal router for Solid inspired by Ember and React Router
MIT License
1.11k stars 138 forks source link

Form action set as insecure by google chrome. #349

Closed AlbertSabate closed 6 months ago

AlbertSabate commented 6 months ago

Describe the bug

When accessing a website with https, the forms action="" that are not https:// are set as insecure by Google Chrome Google Chrome Docs.

The new form action on @solidjs/router renders the markup like this:

<form method="post" action="action:signUpForm">...</form>

Google Chrome sets it as insecure, as shown in the image below.

Screenshot 2024-01-04 at 11 04 24 PM

Your Example Website or App

https://start.solidjs.com/core-concepts/actions#using-forms-to-submit-data

Steps to Reproduce the Bug or Issue

Create a form using the example on the solidjs/start a website. Open the site using https. Click on any input, and the message will show.

Expected behavior

The form should not be set as insecure as it could generate distrust from the users.

Screenshots or Videos

No response

Platform

Google Chrome.

Additional context

No response

AlbertSabate commented 6 months ago

Okay, I've tested changing action for https://action, and Google Chrome is blocking the request. I needed to use a valid domain format so the colon would not be allowed unless followed by numbers. I changed it to https://action--. The redirect is working fine, but the handleFormSubmit cannot evt.preventDefault(), and the action post is being triggered into a broken page. Improving the format further and replacing -- for / is working fine, and the event can be default prevented.

Current working format https://action/${eventName}

ryansolid commented 6 months ago

Alright 0.10.7 is released