Closed joshleeb closed 6 years ago
Thanks for noticing this and for providing #232. It's mostly something that wasn't done initially because there was no immediate use case. I suspect I was also maintaining some kind of bias against unpredictable headers.
Out of curiosity, what's your use case? What are the headers that you have that aren't predictable?
I use a wrapper around gabbi that, amongst other things, helps to handle request authentication throughout the suite of e2e tests. Specifically, this wrapper sets variables in $ENVIRON
which are read from a config file. It's then possible to dynamically provide the required authentication token in a request header.
Up until recently, the header key hasn't changed, but now I am needing to extend the wrapper to read the header key from the config as well so it can by dynamically changed in the tests.
Overall it provides a bit more flexibility with the test suite in being able to run it with different authentication methods and tokens.
Substitution doesn't seem to occur for the key of
request_headers
. For example:Having this test works as expected, where
$ENVIRON['HEADER_VAL']
is replaced by the value ofHEADER_VAL
.Yet, this test doesn't work as
$ENVIRON['HEADER_KEY']
isn't substituted withHEADER_KEY
.As a side note, this may have some relevance to #219.