-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature addition: skipIISCustomErrors #568
Open
mparq
wants to merge
22
commits into
tjanczuk:master
Choose a base branch
from
mparq:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update ReadMe
IHTTPResponse::SetStatus needs to be called with this flag set in order for iisnode to bypass IIS custom errors when errorMode="Auto"
Users can opt into the fTrySkipCustomErrors flag behavior with skipIISCustomErrors="true". If this option is not specified, then the default behavior will match the previous behavior.
Internal iisnode errors should probably not set fTrySkipCustomErrors since these are just empty status responses. Let IIS capture and replace these responses with more detailed messages depending on the custom error mode.
iisnode crash fix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(see #446 and #476)
This feature will allow a mixed solution to error handling with IIS and iisnode rather than relying
<httpErrors existingResponse="PassThrough" />
to work around IIS trying to replace error responses from the node application with custom friendly error pages.
The default mechanism
existingResponse="Auto"
allows for the following behavior:This feature would allow an opt-in into option 1, where responses returned from the node application through iisnode would call
IHttpResponse::SetStatus
with thefTrySkipCustomErrors
flag set if iisnode is configured withskipIISCustomErrors="true"
. Empty error responses resulting from internal iisnode errors will not be affected by this, so that those errors can be handled by IIS. This is only really a factor ifdevErrorsEnabled="false"
.This sort of work flow is useful because usually the node application should be gracefully handling and creating friendly/helpful error responses to be passed to the client. Sometimes,
existingResponse="PassThrough"
is acceptable for this if you never need to do any custom error handling outside of iisnode. However, if you happened to need this, then you are stuck. For example, if you would like to route users of your site to a friendly error page directing them to request the necessary security group accesses they need if they do not pass authentication, then you need to implement custom error routing in the<httpErrors>
section of your web config since this sort of error is not under iisnode's purview. But anything other thanexistingResponse="PassThrough"
will interfere with your existing node application error messages.With this feature, you can set
skipIISCustomErrors="true"
in iisnode's configuration so that any responses sent back through iisnode from the node application will be passed with the TrySkipIISCustomErrors flag. This will allow these responses to pass through whenexistingResponse="Auto"
, while still allowing custom errors to be sent to clients for errors external to iisnode.