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

PUT /api/subscribers/lists does not work with Authorization header #2306

Open
fadorator opened this issue Feb 12, 2025 · 0 comments
Open

PUT /api/subscribers/lists does not work with Authorization header #2306

fadorator opened this issue Feb 12, 2025 · 0 comments
Labels
needs-investigation Potential bug. Needs investigation

Comments

@fadorator
Copy link

fadorator commented Feb 12, 2025

Version:

  • listmonk: 4.1.0
  • OS: Linux (docker container)

Description of the bug and steps to reproduce:

The API endpoint /api/subscribers/lists with HTTP method PUT does not make any changes if called with Authorization header. At least not with action = remove and action = add.
If called with a cookie header, it works fine.

I tried to add and remove a subscriber from a list, which works fine with the cookie header.

This API call adds the subscriber 66 to list 1:

curl 'http://localhost:9000/api/subscribers/lists' \
  -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' \
  -H 'Cookie: session=mysessionid' \
  --data-raw '{"action":"add","list_ids":null,"target_list_ids":[1],"status":"confirmed","ids":[66]}'

This one does not:

curl 'http://localhost:9000/api/subscribers/lists' \
  -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' \
  -H 'Authorization: token myuser:mykey' \
  --data-raw '{"action":"add","list_ids":null,"target_list_ids":[1],"status":"confirmed","ids":[66]}'

Both calls return {"data":true}.

I created the first curl command by copying it from the Firefox developer tools and removed all irrelvant parameters. The second one is identical apart from the authorization.

Can anyone confirm this behaviour?

@knadh knadh added the needs-investigation Potential bug. Needs investigation label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-investigation Potential bug. Needs investigation
Projects
None yet
Development

No branches or pull requests

2 participants