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

fix: revert directly modifying DOM over setAttribute #614

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

luqven
Copy link
Contributor

@luqven luqven commented Mar 2, 2021

Changes

  • This PR addresses a suggestion to revert back part of commit 62c51dc.
  • It fixes a bug where getElementByTagName() was attempting to access an attribute, .innerHTML, that was not defined.
  • The commit in question was an attempt to fix a CSP issue. You can find more on the discussion around how to best address the CSP issue here.

@luqven luqven requested a review from sherwinski March 2, 2021 00:45
@luqven luqven requested a review from a team as a code owner March 2, 2021 00:45
@luqven luqven self-assigned this Mar 2, 2021
@commit-lint
Copy link

commit-lint bot commented Mar 2, 2021

Bug Fixes

  • revert "refactor: favor directly modifying DOM attributes over setAttribute" (6e2c4b8)

Contributors

luqven

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

Copy link
Contributor

@frederickfogerty frederickfogerty left a comment

Choose a reason for hiding this comment

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

@luqven
Copy link
Contributor Author

luqven commented Mar 2, 2021

LGTM. Shall we also revert this change? https://github.com/imgix/drift/pull/598/files#diff-30df8ba766bab70ef0339cf7ffcbed9bb1944d326fbad5e039b322fcc98c9d52L245

Great 🎉 Thanks!

So I had at first. Turns out this change does address, in part, a CSP issue. If we revert it we re-introduce a CSP issue and would need to add this style change as a hash to the index.html CSP example. I think it's best if we leave it as is.

@luqven luqven merged commit 2da753d into main Mar 2, 2021
@luqven luqven deleted the luis/rollbackDomFix branch March 2, 2021 13:18
@frederickfogerty
Copy link
Contributor

Sounds good @luqven 👍

@sherwinski sherwinski linked an issue Mar 4, 2021 that may be closed by this pull request
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.

Content-Security-Policy blocking inline styles
2 participants