feat: Allow --error-path fallback when --error-target error fetch fails#646
Closed
kaddynator wants to merge 7 commits into
Closed
feat: Allow --error-path fallback when --error-target error fetch fails#646kaddynator wants to merge 7 commits into
kaddynator wants to merge 7 commits into
Conversation
Co-authored-by: vishnuvv27 <vishnuvv27@users.noreply.github.com>
Co-authored-by: vishnuvv27 <vishnuvv27@users.noreply.github.com>
f854698 to
d6564b1
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
…rorFromPath In Node 22+, OutgoingMessage.writable delegates to socket.writable which can return false for an established server-side socket in certain async callback contexts (e.g. inside the errorRequest 'error' event callback). This caused _handleProxyErrorFromPath to silently return without sending any response, leaving fetch() hanging until the jasmine timeout fired. Use res.writableEnded (consistent with _handleProxyErrorDefault) and add a !res.headersSent guard before res.writeHead to match the existing pattern.
for more information, see https://pre-commit.ci
Co-authored-by: Cursor <cursoragent@cursor.com>
for more information, see https://pre-commit.ci
Member
|
This seems like a reasonable goal! Sorry we haven't communicated it widely yet, so it wasn't clear already before the PR was opened, but we have adopted an LLM policy that requires human authorship of all code and documentation and communication. Since this PR has commits attributed to Cursor, it violates that policy and cannot be accepted, so I will close it. If you'd like to contribute to JupyterHub in the future, please feel free to read our contributing documentation. |
This file contains hidden or 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
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.
Problem:
Today you must choose either --error-target or --error-path. If --error-target is set and the request to the custom error server fails (hub down, connection refused, etc.), CHP only returns the generic plain-text response. Static HTML under --error-path is never used in that case.
Change:
Permit both --error-target and --error-path. When --error-target is configured, CHP still tries the custom error URL first. On request error, serve HTML from --error-path using the existing rules ({code}.html, then error.html, else default).
Fix --error-path CLI help: it is a directory of HTML files, not another proto://host server.
Add a test that uses an unreachable errorTarget and asserts responses come from the error-path fixtures.
Backward compatibility:
Using only --error-target or only --error-path behaves as before. If both are set, behavior is: dynamic page when reachable; otherwise file-based fallback.