Comments (5)
Enclosing the header value between quotes adds quotes to the value itself.
The typical example is the ETag header
ETag: "<etag_value>"
We can indeed clarify that in the doc
The error message is a bit clearer if we receive only one Content-Encoding header.
|
21 | Content-Encoding: "gzip"
| ^^^^^^ actual value is <gzip>
Back to your example,
you receive two headers with value <gzip>
, which is treated as a list of 2 strings .
The error message could be maybe improved to:
|
21 | Content-Encoding: "gzip"
| ^^^^^^ actual value is [<gzip>, <gzip>]
from hurl.
The fact is that I can't assert that I have the header without quotes but only once can I ?
Because now that I fixed my bug and my service returns the header only once, the check if quote fails (just as in your first snippet), but if my assertion is without quotes, it passes, but it passed also with two headers...
How would you check for only one header with a value without quotes ?
from hurl.
Indeed, an implicit header assert (defined directly after the status code) does not fail with duplicate headers.
In order to test that, you need to use the explicit header assert
[Asserts]
header "Content-Encoding" equals "gzip"
Current, removing an implicit header just remove a check.
If the hurl file passed before, it will pass after.
that's the reason why we choose to ignore the duplicate header issue.
This also works nicely with the Set-Cookie header.
from hurl.
Thanks !
from hurl.
doc on headers has been updated
from hurl.
Related Issues (20)
- Generate junit report directory structure too (mkdir -p) HOT 4
- Installer is identified as containing virus by Microsoft Defender HOT 3
- Custom options section to avoid polluting the headers HOT 3
- Generate tap report directory structure too (mkdir -p)
- Crash when capturing 'Expires' cookie attribute
- Crash with `--json` option when capturing 'HttpOnly' and 'Secure' cookie attribute
- Equality on date not respected
- Typo in "issuer" field when exporting SSL certificates to JSON
- Normalise SSL certificate's issuer and subject
- Output is truncated when using --json and --output together HOT 1
- SPlit HTML/JUNIT report into test cases HOT 1
- Add option to print response bodies for each entry in file HOT 3
- Automatic pagination that continues until exhaustion HOT 4
- hurlfmt check always returns non-zero exit code HOT 3
- Improve error message when CLI option doesn't exist
- Type parsing error for [Options] items are not explicit
- How to run an interactive shell in the docker image ? HOT 4
- jsonpath: indexing inside of Filter expression does not work HOT 1
- Support secrets: things that should not be saved verbatim HOT 3
- Allow users to parameterize test
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hurl.