Do not rely on Referer HTTP header data when creating topic on Discourse (#921)
Do not rely on Referer HTTP header data when creating topic on Discourse (#921)

Assume that the web browser wiped the referrer data (path, query, ...)
because calling the API endpoint.
This changes rebuilds the referrer URL by using both the document identifier
passed in the request payload and the database to retrieve the document type.

Fixes #736
c2corg/v6_api,c2corg/v6_api,c2corg/v6_api