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

Assert no input with name __amp_source_origin in the form #4671

Merged
merged 2 commits into from Aug 24, 2016

Conversation

mkhatib
Copy link
Contributor

@mkhatib mkhatib commented Aug 23, 2016

Make sure no inputs are named __amp_source_origin to make sure no one spoof the runtime-only attribute in their forms.

ITI: #3343

@@ -107,6 +107,17 @@ describe('amp-form', () => {
expect(() => new AmpForm(form)).to.not.throw;
});

it('should assert none of the inputs named __amp_source_origin', () => {
const form = getForm(document, true, false);
const illegalInput = document.createElement('input');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, you should be able to use the util method in dom.js
createElementWithAttributes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't exist.

@lannka
Copy link
Contributor

lannka commented Aug 24, 2016

LGTM

@lannka lannka added LGTM and removed NEEDS REVIEW labels Aug 24, 2016
@mkhatib mkhatib merged commit 9e27ada into ampproject:master Aug 24, 2016
@mkhatib mkhatib deleted the input-name-srcorig branch August 24, 2016 18:41
mityaha pushed a commit to ooyala/amphtml that referenced this pull request Nov 30, 2016
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.

None yet

3 participants