Merge pull request #9231 from jakemcdermott/fix-9229

Prevent url smashing from prompted inputs

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot]
2021-02-04 16:44:24 +00:00
committed by GitHub
3 changed files with 15 additions and 3 deletions

View File

@@ -84,7 +84,11 @@ function CredentialPasswordsStep({ launchConfig, i18n }) {
} }
return ( return (
<Form> <Form
onSubmit={e => {
e.preventDefault();
}}
>
{showcredentialPasswordSsh && ( {showcredentialPasswordSsh && (
<PasswordField <PasswordField
id="launch-ssh-password" id="launch-ssh-password"

View File

@@ -22,7 +22,11 @@ const FieldHeader = styled.div`
function OtherPromptsStep({ launchConfig, i18n }) { function OtherPromptsStep({ launchConfig, i18n }) {
return ( return (
<Form> <Form
onSubmit={e => {
e.preventDefault();
}}
>
{launchConfig.ask_job_type_on_launch && <JobTypeField i18n={i18n} />} {launchConfig.ask_job_type_on_launch && <JobTypeField i18n={i18n} />}
{launchConfig.ask_limit_on_launch && ( {launchConfig.ask_limit_on_launch && (
<FormField <FormField

View File

@@ -33,7 +33,11 @@ function SurveyStep({ surveyConfig, i18n }) {
float: NumberField, float: NumberField,
}; };
return ( return (
<Form> <Form
onSubmit={e => {
e.preventDefault();
}}
>
{surveyConfig.spec.map(question => { {surveyConfig.spec.map(question => {
const Field = fieldTypes[question.type]; const Field = fieldTypes[question.type];
return ( return (