You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spent a bit of time trying to pass a "content-type" header to io.pedestal.service.test/response-for before realizing I needed to pass a "Content-Type" header instead.
Do we suppose this is a sufficiently-common error that it's worth searching for arbitrarily-cased headers in the test-servlet-request fn?
If so, I'll submit a PR.
The text was updated successfully, but these errors were encountered:
Hmm, so we'd be lenient consider things like "content-type" or :content-type or :Content-Type. I wonder how far sweeping this leniency would have to be given we normally deal in maps?
The goal of the faux servlet test infrastructure is to ensure that your
service code works with the data it would get from a servlet, so the goal
should be to emulate that data. That said, the servlet-interceptor
lower-cases header names when it builds the headers map for the request
map. So this seems like a reasonable change in response-for. The main risk
to this change is that if, at some point, servlet-interceptor did something
more with headers, some tests that used lower-case headers might break. I
would prefer we use correct casing for HTTP headers, as per the spec, but
if this is a real pain point, I'm not against making the test jig a little
more lenient.
Hmm, so we'd be lenient consider things like "content-type" or
:content-type or :Content-Type. I wonder how far sweeping this leniency
would have to be given we normally deal in maps?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/79#issuecomment-18752926
.
Re: https://github.com/pedestal/pedestal/blob/master/service/src/io/pedestal/service/test.clj#L96-97
I spent a bit of time trying to pass a "content-type" header to io.pedestal.service.test/response-for before realizing I needed to pass a "Content-Type" header instead.
Do we suppose this is a sufficiently-common error that it's worth searching for arbitrarily-cased headers in the test-servlet-request fn?
If so, I'll submit a PR.
The text was updated successfully, but these errors were encountered: