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

Negative offset #1667

Closed
UkonnRa opened this issue Dec 18, 2019 · 3 comments
Closed

Negative offset #1667

UkonnRa opened this issue Dec 18, 2019 · 3 comments
Labels
bug Something is not working.

Comments

@UkonnRa
Copy link

UkonnRa commented Dec 18, 2019

Describe the bug

Say I have only one client in ORY Hydra server. And when I am using GET /clients, the Link header is:

Link: </clients?limit=100&offset=0>; rel="first",</clients?limit=100&offset=-100>; rel="prev"

Expected behavior

In this situation, the expected result is containing first link only

Environment

Using the latest docker image:

# docker.yml
  hydra:
    image: oryd/hydra:latest
    ports:
      - "4444:4444" # Public port
      - "4445:4445" # Admin port
      - "5555:5555" # Port for hydra token user
    command:
      serve all --dangerous-force-http
    environment:
      - URLS_SELF_ISSUER=http://127.0.0.1:4444
      - URLS_CONSENT=http://127.0.0.1:4201/static/consent
      - URLS_LOGIN=http://127.0.0.1:4201/static/login
      - URLS_LOGOUT=http://127.0.0.1:4201/static/logout
      - DSN=memory
      - SECRETS_SYSTEM=youReallyNeedToChangeThis
      - LOG_LEVEL=debug

    restart: unless-stopped
@aeneasr
Copy link
Member

aeneasr commented Dec 19, 2019

Nice catch!

@aeneasr aeneasr added the bug Something is not working. label Dec 19, 2019
@aeneasr
Copy link
Member

aeneasr commented Dec 19, 2019

Would you be able to fix this? The code is located at: https://github.com/ory/x/blob/master/pagination/header.go

@UkonnRa
Copy link
Author

UkonnRa commented Dec 19, 2019

Well, embarrassing, I have no idea how to write Go at all, this is a total black box for me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

2 participants