Closed mtiller closed 1 year ago
@mtiller sorry for being late but I don't get emails about new commits, just comments.
Hello @mtiller / @icebob .
Some questions about this change .
Actually, the spec doesn't restrict the use of the Location
header . So every status code can use it .
Also, about the 201 code, the specification says :
The primary resource created by the request is identified by either a Location header field in the response or, if no Location header field is received, by the target URI
so the warning on https://github.com/moleculerjs/moleculer-web/pull/297/files#diff-bfe9874d239014961b1ae4e89875a6155667db834a410aaaa2ebe3cf89820556R707 is not relevant in this case (nor in others because of the specification, but I can understand that can be interesting for some peoples)
@thib3113 nice catch, could you create a PR with ignoring the warning in case of 201?
The
Location
header is also used by the201 Created
status code. But the currently logic filters out the information provided inctx.meta.$location
if I returnctx.meta.$statusCode = 201
. This should not happen. TheLocation
header is essential in a201 Created
response. I've changed to logic so that201
is included in the status codes that passthroughctx.meta.$location
to theLocation
header.