gotify / server

A simple server for sending and receiving messages in real-time per WebSocket. (Includes a sleek web-ui)
https://gotify.net
Other
11.52k stars 639 forks source link

option to include back path prefix #664

Open hydrargyrum opened 4 months ago

hydrargyrum commented 4 months ago

Can the issue be reproduced with the latest available release? y

Which one is the environment gotify server is running in?

Do you have an reverse proxy installed in front of gotify server? (Please select None if the problem can be reproduced without the presense of a reverse proxy)

[…]
  route /gotify/* {
    uri strip_prefix /gotify
    # Set the port to the one you are using in gotify
    reverse_proxy localhost:1245
  }
[…]

On which client do you experience problems? (Select as many as you can see)

What did you do?

curl -H "x-gotify-key: $token" 'https://example.com/gotify/message?limit=100&since=xxx'

What did you expect to see?

In the resulting JSON, next key points to https://example.com/gotify/message?limit=100&since=yyy

What did you see instead? (Include screenshots, android logcat/request dumps if possible)

Instead it points to https://example.com/message?limit=100&since=yyy losing the /gotify/ prefix.

The reverse-proxy configuration strips the prefix, so it's rather expected that gotify receives URLs without the prefix. So gotify should have an option to include that prefix when it emits URLs, like next.

jmattheis commented 4 months ago

Good catch, this was missed in https://github.com/gotify/server/pull/127. I think clients should built build the url manually and we should deprecate the next property.