Avoid custom headers to be undefined
This commit is contained in:
parent
f31e8b43b6
commit
6bcf477532
1
NEWS.md
1
NEWS.md
@ -24,6 +24,7 @@ Announcements:
|
|||||||
- Remove `bootstrapFonts` at process startup (now done in `windshaft@6.0.0`)
|
- Remove `bootstrapFonts` at process startup (now done in `windshaft@6.0.0`)
|
||||||
- Stop checking the installed version of some dependencies while testing
|
- Stop checking the installed version of some dependencies while testing
|
||||||
- Send metrics about `map views` (#1162)
|
- Send metrics about `map views` (#1162)
|
||||||
|
- Add custom headers in responses to allow to other components to be able to get insights about user activity.
|
||||||
|
|
||||||
Bug Fixes:
|
Bug Fixes:
|
||||||
- Parsing date column in numeric histograms (#1160)
|
- Parsing date column in numeric histograms (#1160)
|
||||||
|
@ -353,7 +353,9 @@ function incrementMapViews ({ metadataBackend }) {
|
|||||||
|
|
||||||
const statTag = mapConfig.obj().stat_tag;
|
const statTag = mapConfig.obj().stat_tag;
|
||||||
|
|
||||||
res.set('Carto-Stat-Tag', `${statTag}`);
|
if (statTag) {
|
||||||
|
res.set('Carto-Stat-Tag', `${statTag}`);
|
||||||
|
}
|
||||||
|
|
||||||
metadataBackend.incMapviewCount(user, statTag, (err) => {
|
metadataBackend.incMapviewCount(user, statTag, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -5,7 +5,9 @@ module.exports = function incrementMapViewCount (metadataBackend) {
|
|||||||
const { mapConfig, user } = res.locals;
|
const { mapConfig, user } = res.locals;
|
||||||
const statTag = mapConfig.obj().stat_tag;
|
const statTag = mapConfig.obj().stat_tag;
|
||||||
|
|
||||||
res.set('Carto-Stat-Tag', `${statTag}`);
|
if (statTag) {
|
||||||
|
res.set('Carto-Stat-Tag', `${statTag}`);
|
||||||
|
}
|
||||||
|
|
||||||
// Error won't blow up, just be logged.
|
// Error won't blow up, just be logged.
|
||||||
metadataBackend.incMapviewCount(user, statTag, (err) => {
|
metadataBackend.incMapviewCount(user, statTag, (err) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user