Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

samples: remove name from the submit field#1671

Merged
shaffeeullah merged 8 commits into
mainfrom
shaffeeullah/fixPostPolicySample
Oct 20, 2021
Merged

samples: remove name from the submit field#1671
shaffeeullah merged 8 commits into
mainfrom
shaffeeullah/fixPostPolicySample

Conversation

@shaffeeullah

Copy link
Copy Markdown
Contributor

No description provided.

@shaffeeullah shaffeeullah requested review from a team October 20, 2021 18:31
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 20, 2021
@product-auto-label product-auto-label Bot added api: storage Issues related to the googleapis/nodejs-storage API. samples Issues that are directly related to samples. labels Oct 20, 2021

// Create an HTML form with the provided policy
let output = `<form action='${response.url}' method='POST' enctype="multipart/form-data">\n`;
let output = `<form action="${response.url}" method="POST" enctype="multipart/form-data">\n`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To save us from this in the future, could you add an integration test for this sample?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i think there is one, it just wasnt checking the form field

it('should generate a v4 signed policy', async () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All it does is check the output of the function and not that the resulting form will be successful.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good point. i will address this in a future PR

@shaffeeullah shaffeeullah requested a review from frankyn October 20, 2021 18:35
output +=
" <input type='submit' value='Upload File' name='submit'/><br />\n";
output += ' <input type="file" name="file"/><br />\n';
output += ' <input type="submit" value="Upload File"/><br />\n';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What issue was the name causing? Also why the quotation style change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The name was causing:

<Error>
<Code>InvalidPolicyDocument</Code>
<Message>The content of the form does not meet the conditions specified in the policy document.</Message>
<Details>Policy did not reference these fields: submit</Details>
</Error>

Quotation change requested here (internal only): https://b.corp.google.com/issues/160889540
It's also HTML convention.

@shaffeeullah shaffeeullah merged commit c5b34c4 into main Oct 20, 2021
@shaffeeullah shaffeeullah deleted the shaffeeullah/fixPostPolicySample branch October 20, 2021 21:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: storage Issues related to the googleapis/nodejs-storage API. cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants