arXiv / arxiv-search

arXiv Search UI & APIs

Home Page:https://arxiv.github.io/arxiv-search/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make the base URL for links in the overridable

mhl10 opened this issue · comments

We are using flask's url_for to generate links in the responses:

        entry.link(
            {
                "href": url_for(
                    "abs",
                    paper_id=doc["paper_id"],
                    version=doc["version"],
                    _external=True,
                ),
                "type": "text/html",
            }
        )

The links are using APPLICATION_ROOT for the base URL when generating those links. Usually this is OK, but in this case we always want the base URL to be https://arxiv.org (and independent of APPLICATION_ROOT).

I think I fixed it now.