Skip to content

some nullbytes are added in the callback when write the card #40

@nicolasburtey

Description

@nicolasburtey

here is an example of a callback:

https://localhost:3000/api/ln?p=9E7F7FBADE31A687A8E8525773139055&c=886FDB3E8AA51797%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00

The code to remove it with node is:

  const raw_c = searchParams.get("c")
  const raw_c_decoded = decodeURIComponent(raw_c)
  const raw_c_nonullbytes = raw_c_decoded.replace(/\x00+$/, "")

not sure why this happen but not having those null value would be better.
took me a bit of time to debug this; this was the reason the callback was not working properly on my end initially.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions