Comments (6)
Could you give me some details on your basic auth setup?
I've got one outstanding issue open regarding 400 responses where auth headers are sent, so I'm curious that you seem to be having the opposite experience.
from wiremock.
Just figured out that wiremock is ignoring expectations on arbitrary headers; I can make the test fail by expecting the wrong Content-Type. However, when I do this:
withHeader("Authorization", equalTo("text/plain"))
(deliberately mixing up Content-Type and Authorization) the test still passes.
from wiremock.
Looks like you've found a bug.
The odd thing is that it looks like I set it up this way on purpose, but since I seem not to have written a unit test that justifies it, I'm going to modify the behaviour so that it won't match when if you expect a header that isn't present in the request.
I'll try and get a 1.32 release out tonight with this included.
from wiremock.
Can you please explicitly make sure (integration testing by hand with curl, maybe) that matching specifically on Authorization
will pass/fail when the credentials do/don't match? Might want to check Cookie
too.
The reason I bring this up is, from a semi-random sampling of different "known" headers, those are the two that don't seem to get checked properly - perhaps Jetty is swallowing them? I was able to verify that matching does work for Content-Type
, Connection
, and User-Agent
at a minimum.
Thanks!
from wiremock.
I've just pushed the 1.32 release with a fix that prevents a stub match when a required header isn't present in the request (it usually takes a few hours to sync to maven central).
I've also added a new acceptance test: StubbingAcceptanceTest.canSupportBasicAuthorization
. This seems to work as expected, although I've had other anecdotes of 400 responses when using basic auth. Perhaps you could review this test case and see if it satisfies the case you're interested in?
from wiremock.
Verified that I can now correctly expect Authorization
header.
from wiremock.
Related Issues (20)
- xPath helper doesn't return result when XPath expression returns a single string item
- wiremock-jetty12: NullPointerException within WireMockHandlerDispatchingServlet (similar to #1224) HOT 1
- Failing while building wiremock-jre8-standalone version 2.31.0 using ./gradlew build (wiremock-jre8-standalone:2.31.0)
- Running tests in parallel with Wiremock 3.0.0 triggers random timing/concurrency issues HOT 2
- @RegisterExtension + WireMockExtension: Timing & state issues when using "static" HOT 5
- EqualsToJson has bad performance for big json with common keys occuring often HOT 17
- Handlebars helper - join
- Init / shutdown hooks for extensions
- Update org.xmlutil:xmlunit-core to Version 2.10.0 HOT 2
- Introduce a GUI for open source HOT 1
- NPE on WireMockServer.getServeEvents when using a StubRequestFilter HOT 1
- Adding more jettyAcceptors seems to do nothing besides cause thread contention. HOT 1
- align new join handlebar helper with features present in the join provided in the library, but not covered yet
- Expose args in Options so extensions can read it
- Possible memory leak ? HOT 15
- Prevent creating multiple stub mappings with the same ID HOT 1
- Support virtual threads in Jetty server for standalone deploy
- Error when proxying to a host that is only accessible via IPv6 HOT 1
- Formatted dates not in UTC
- __files created by default since v3.6.0 HOT 1
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 wiremock.