Skip to content

fix: Auto detect SVG content-type#19342

Merged
kodiakhq[bot] merged 6 commits intomainfrom
fix/pluginui-svg-content-type
Oct 10, 2024
Merged

fix: Auto detect SVG content-type#19342
kodiakhq[bot] merged 6 commits intomainfrom
fix/pluginui-svg-content-type

Conversation

@disq
Copy link
Copy Markdown
Member

@disq disq commented Oct 10, 2024

No description provided.

@disq disq requested review from a team and marianogappa and removed request for a team October 10, 2024 11:07
@disq disq changed the title fix(pluginui): Auto detect SVG content-type fix: Auto detect SVG content-type Oct 10, 2024
@erezrokah erezrokah requested review from erezrokah and removed request for marianogappa October 10, 2024 11:18
}{
{
filename: "octetstream.svg",
data: []byte(`<svg xmlns="http://www.w3.org/2000/svg" width="2500" height="330" viewBox="0 0 719.713 94.943"><g fill-rule="evenodd" clip-rule="evenodd"><path d="M17.32,16.76l-.53.53-1.09-1.1a4.33,4.33,0,0,0,.53-.52Z" style="fill:#4285f4"/></g></svg>`),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we embed these files instead to make it easier to read the tests?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in a5579c5

contentType := http.DetectContentType(filebytes)
if contentType == "application/octet-stream" {
switch {
case contentType == "application/octet-stream":
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can use the mime package similar to golang/go#15888 (comment) WDYT?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in a5579c5

@hermanschaaf
Copy link
Copy Markdown
Contributor

Linting error in the latest commit:

 Error: cli/internal/publish/pluginui_test.go:55:64: copyTempFile - result 1 (error) is always nil (unparam)
  func copyTempFile(t *testing.T, src, destName string) (string, error) {

@erezrokah erezrokah added the automerge Automatically merge once required checks pass label Oct 10, 2024
@kodiakhq kodiakhq bot merged commit f355be8 into main Oct 10, 2024
@kodiakhq kodiakhq bot deleted the fix/pluginui-svg-content-type branch October 10, 2024 12:27
kodiakhq bot pushed a commit that referenced this pull request Oct 10, 2024
🤖 I have created a release *beep* *boop*
---


## [6.8.3](cli-v6.8.2...cli-v6.8.3) (2024-10-10)


### Bug Fixes

* Auto detect SVG content-type ([#19342](#19342)) ([f355be8](f355be8))
* **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.22.4 ([#19274](#19274)) ([c6eda0c](c6eda0c))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.64.0 ([#19287](#19287)) ([49941ee](49941ee))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.65.0 ([#19322](#19322)) ([87a68ea](87a68ea))
* **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.66.0 ([#19332](#19332)) ([137a232](137a232))
* **deps:** Update module google.golang.org/grpc to v1.67.0 ([#19255](#19255)) ([a154662](a154662))
* **deps:** Update module google.golang.org/grpc to v1.67.1 ([#19327](#19327)) ([5299c4b](5299c4b))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants