Copy of https://pagure.io/fedora-infrastructure/issue/12886
I am using libpagure to read data from pagure tickets using an authentication token and my script doesn't work any more because of the anubis deployment.
Minimal reproducer: I have a pagure token with the following permissions:
$ cat /tmp/pagure_minimal.py #!/usr/bin/python3 from libpagure import Pagure import sys print("Access issue without any token") pg = Pagure(pagure_repository="freeipa") data = pg.issue_info("7979") print(data) print("Access issue with token") pg2 = Pagure(pagure_repository="freeipa", pagure_token=sys.argv[1]) data2 = pg2.issue_info("7979") print(data2)
My token is set in $PAGURE_TOKEN and when I use libpagure to access the issue: - the API works if I don't provide any token - the API fails if I provide my token
We figured out that adding Accept: */* header is enough to restore communication with pagure.io.
Accept: */*
Perhaps, libpagure should set this header by default?
Fix: https://pagure.io/libpagure/pull-request/53
Metadata Update from @abbra: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)