[annotator-dev] How to use dynamically changing headers in App without Starting App again.

Randall Leeds randall at bleeds.info
Sun Dec 2 07:00:48 UTC 2018


You can provide headers as a object and update it later. The HTTP plugin
will hold a reference to the object and use it. This will work where
passing an object literal with a key bound to the instantaneous value of
`window.dynamicToken` will only capture the initial token.

Alternatively, you can call the `setHeader` method of the plugin whenever
the value changes.

On Wed, Nov 28, 2018 at 4:21 AM wsol Pearson <wsolpearson at gmail.com> wrote:

> Hi All,
>
> In annotator.storage.http I am using a dynamic header value which changes
> time to time. The issue is annotatorjs is sending the initial Token only.
> It won't change the header value as it get updated. Is this a issue or are
> there any workarounds for this.
>
> headers: {
>                         'X-Authorization': window.dynamicToken // dynamic
>      }
>
> _______________________________________________
> annotator-dev mailing list
> annotator-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/annotator-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20181201/d721ad45/attachment.html>


More information about the annotator-dev mailing list