SDFIdk / skraafoto_stac_public

Other
6 stars 1 forks source link

Links are constructed with reference to "http://load201.kmsext.dk" #8

Closed NicolaiLolansen closed 2 years ago

NicolaiLolansen commented 2 years ago

Example the link: https://api.dataforsyningen.dk/skraafotoapi_test/collections?&token=None

Construcs a link property like so:

...
        {
          "rel": "self",
          "type": "application/geo+json",
          "href": "http://load202.kmsext.dk/collections/skraafotos2019/items/2019_83_37_2_0046_00001113?token=4adf32524ae6d6998565f638a1090ba1"
        },
        {
          "rel": "parent",
          "type": "application/json",
          "href": "http://load202.kmsext.dk/collections/skraafotos2019?token=4adf32524ae6d6998565f638a1090ba1"
        },
        {
          "rel": "collection",
          "type": "application/json",
          "href": "http://load202.kmsext.dk/collections/skraafotos2019?token=4adf32524ae6d6998565f638a1090ba1"
        },
        {
          "rel": "root",
          "type": "application/json",
          "href": "http://load202.kmsext.dk/?token=4adf32524ae6d6998565f638a1090ba1"
        },
        {
          "rel": "license",
          "href": "https://sdfe.dk/om-os/vilkaar-og-priser",
          "type": "text/html; charset=UTF-8",
          "title": "SDFE license terms"
        },
...

http://load202.kmsext.dk should be https://api.dataforsyningen.dk instead.

NicolaiLolansen commented 2 years ago

From uvicorn documentation:

--proxy-headers / --no-proxy-headers
                                  Enable/Disable X-Forwarded-Proto,
                                  X-Forwarded-For, X-Forwarded-Port to
                                  populate remote address info.

Adding just this to the docker file, seems to have no change.

AsgerPetersen commented 2 years ago

Fixed in 603e7aac6c5b0b930f3fe21db45122350de6098c and subsequent commits by setting server "host" and "root_path" from the "x-forwarded-xxx" headers in middleware.