Skip to content

Do not leak unknown asset paths into HTML#3061

Merged
IgnatBeresnev merged 3 commits intomasterfrom
3040-do-not-leak-resources
Jul 7, 2023
Merged

Do not leak unknown asset paths into HTML#3061
IgnatBeresnev merged 3 commits intomasterfrom
3040-do-not-leak-resources

Conversation

@IgnatBeresnev
Copy link
Copy Markdown
Contributor

Fixes #3040

@IgnatBeresnev IgnatBeresnev requested a review from vmishenev July 6, 2023 16:13
it.isImage() -> link(href = if (it.isAbsolute) it else "$pathToRoot$it")
else -> null
}
} ?: it)
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 bug was with ?: it

Comment thread plugins/base/src/test/kotlin/resourceLinks/ResourceLinksTest.kt Outdated
}

@Test
fun `should load script as defer if name ending in _deferred`() {
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 wrote this test a while ago, and at the time I couldn't find a good place for it, but I think having it in ResourceLinksTest is better now, so I moved it there.

Comment thread plugins/base/src/test/kotlin/resourceLinks/ResourceLinksTest.kt Outdated
Comment thread plugins/base/src/test/kotlin/resourceLinks/ResourceLinksTest.kt Outdated
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.

Directory path of customAssets is being displayed on the main index page

2 participants