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

PSS Send: target is truncated to 4 characters #380

Closed
Cafe137 opened this issue Jul 29, 2021 · 1 comment · Fixed by #384
Closed

PSS Send: target is truncated to 4 characters #380

Cafe137 opened this issue Jul 29, 2021 · 1 comment · Fixed by #384

Comments

@Cafe137
Copy link
Collaborator

Cafe137 commented Jul 29, 2021

url: `${url}${endpoint}/send/${topic}/${target.slice(0, 4)}`,

@Cafe137
Copy link
Collaborator Author

Cafe137 commented Jul 30, 2021

The truncation is there for a reason. Bee returns a bad request if target is more than 2 bytes. See ethersphere/bee#2382 and https://github.com/ethersphere/bee/blob/master/pkg/api/pss.go#L47.

Slicing and having no documentation on this behaviour in bee-js still seems to be an issue though. It would probably be a better approach to do proper input validation and throw an error if length is too long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant