Skip to content

Commit 06f0090

Browse files
committed
fix release workflow and add xss-1 test
1 parent 6fc8585 commit 06f0090

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.github/workflows/release.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
uses: actions/checkout@v2
1616
- name: Build project # This would actually build your project, using zip for an example artifact
1717
run: |
18-
GOOS=linux GOARCH=amd64 go build -o monokube main.go
19-
tar -czvf monokube-linux-amd64.tar.gz monokube
18+
GOOS=linux GOARCH=amd64 go build -o daz daz.go
19+
tar -czvf daz-linux-amd64.tar.gz daz
2020
- name: Create Release
2121
id: create_release
2222
uses: actions/create-release@v1
@@ -34,6 +34,6 @@ jobs:
3434
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3535
with:
3636
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
37-
asset_path: ./monokube-linux-amd64.tar.gz
38-
asset_name: monokube-linux-amd64.tar.gz
37+
asset_path: ./daz-linux-amd64.tar.gz
38+
asset_name: daz-linux-amd64.tar.gz
3939
asset_content_type: application/gzip

daz_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var fixture3 = "<div><div>one</div>one<>text</></div>"
1010
var fixture4 = "<div class='bg-grey-50' data-id='div-1'>content</div>"
1111
var fixture5 = "<div>O&#39;Brian<input type='text' value='input value&#39;s' /></div>"
1212
var fixture6 = "<div><img src='https://example.com/image.png' /><br /></div>"
13+
var fixture7 = "<div>&lt;script&gt;alert(&#39;xss&#39;)&lt;/script&gt;</div>"
1314

1415
func TestBasicRender(t *testing.T) {
1516
attrs := Attr{"class": "app view"}
@@ -72,6 +73,14 @@ func TestSelfClosing(t *testing.T) {
7273
}
7374
}
7475

76+
func TestXSS1(t *testing.T) {
77+
root := H("div", "<script>alert('xss')</script>")
78+
res := root()
79+
if res != fixture7 {
80+
t.Errorf("got: %v wanted: %v", res, fixture7)
81+
}
82+
}
83+
7584
func BenchmarkBasicRender(b *testing.B) {
7685
attrs := Attr{"class": "app view"}
7786
nav := H("nav", "Welcome")

0 commit comments

Comments
 (0)