m-lab / ndt7-js

Apache License 2.0
22 stars 17 forks source link

Add metadata configuration field #65

Closed robertodauria closed 2 years ago

robertodauria commented 2 years ago

This PR adds the metadata field to the config object passed to ndt7.test() and two default static metadata fields (client_library_name and client_library_version).

The static metadata fields will overwrite fields with the same name, if provided, since these identify the library code rather than the "client" and not meant to be replaced by the integrator.

There is no other restriction on which fields can be provided, and the code makes sure the metadata fields are prefixed with client_ automatically so they are stored by the server.

This can also be used to implement HTML5 geolocation, by providing config.metadata.geohash when calling ndt7.test().


This change is Reviewable