Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for relative URLs in callbacks, allowing them to reference routes within the same Mockoon server. The implementation includes a new serverHost configuration option (though not yet utilized), infinite loop prevention for callbacks, and adds debugging headers for internal callback invocations. The Angular component is also refactored to use the modern @if/@for control flow syntax.
Key Changes
- Added
serverHostproperty toServerOptionsto enable custom host override for callback URL resolution - Implemented relative URL detection and resolution for callbacks with automatic protocol and port addition
- Added infinite loop prevention and debugging headers for internal callback invocations
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/commons/src/models/server.model.ts | Added serverHost optional property to ServerOptions for custom host configuration |
| packages/commons-server/src/libs/server/server.ts | Refactored callback execution with relative URL support, infinite loop prevention, and enhanced debugging headers |
| packages/app/src/renderer/app/components/environment-callbacks/environment-callbacks.component.ts | Removed unused Angular imports (NgIf, NgFor) as template migrated to new control flow |
| packages/app/src/renderer/app/components/environment-callbacks/environment-callbacks.component.html | Migrated from *ngIf/*ngFor to modern @if/@for` syntax and updated placeholder text for URL input |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
157780f to
ec07491
Compare
ec07491 to
597b141
Compare
- add new publicHostUrl property to the server configuration to allow resolution override (especially in the cloud) - add new headers when doing internal calls to make debugging easier and prevent infinite loops - add new CLI flag --public-base-url Closes #1730
597b141 to
e7316e3
Compare
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.
Closes #1730
Technical implementation details
Checklist
Closes #{issue_number}