Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ The following emojis are used to highlight certain changes:

### Fixed

- Improvements to support WASM builds
- `gateway`: Fixed suffix range-requests and updated tests to [gateway-conformance v0.8](https://github.com/ipfs/gateway-conformance/releases/tag/v0.8.0) [#922](https://github.com/ipfs/boxo/pull/922)


### Security


Expand Down
18 changes: 18 additions & 0 deletions files/filewriter_js.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//go:build js

package files

import (
"os"
"strings"
)

var invalidChars = `/` + "\x00"

func isValidFilename(filename string) bool {
return !strings.ContainsAny(filename, invalidChars)
}

func createNewFile(path string) (*os.File, error) {
return os.OpenFile(path, os.O_EXCL|os.O_CREATE|os.O_WRONLY, 0o666)
}
2 changes: 1 addition & 1 deletion files/filewriter_unix.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build darwin || linux || netbsd || openbsd || freebsd || dragonfly || js || wasip1
//go:build darwin || linux || netbsd || openbsd || freebsd || dragonfly

package files

Expand Down