Oh actually, we do not need a function here as `mode` won't change.
we can simply do:
let isGetOrHead = (mode == "GET" || mode == "HEAD");