Express 6.1.0 | EventLog | Demo GUI#10
Merged
Merged
Conversation
jo-tools
commented
Mar 4, 2024
|
|
||
| // Get the length of the content that has been received. | ||
| Var contentReceivedLength As Integer = Body.Bytes | ||
| Var DataReceivedLength As Integer = Lookahead.Bytes |
Collaborator
Author
There was a problem hiding this comment.
I'm not quite happy with that change.
Data needs to be appended (in case this Event fires multiple times).
However, Body ist just part of Data, and Content-Length has to be the Body-Length (not Data Length).
I'll push a change shortly to do this correctly.
Collaborator
Author
There was a problem hiding this comment.
Done... see commit below.
- Data is now always being appended while
.ReadAll. - Comparison against
Content-Lengthnow always compares toBody.Bytes Datais cleared when no longer needed in MethodProcessProcesschecksBody.Bytes <> ContentLengthand returns Error 400 (Bad Request) if needed
So back to previous Body/Content-Length comparison, while still having the fix regarding parsing the Body in case of Multipart Form Data.
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.
Express 6.1.0
Introduces: Express.EventLogHandlerDelegate
Express is designed to be a standalone component that can be dropped into any Xojo project.
Each Xojo project might want to handle Logs differently.
Express provides a default logging facility in:
Express.EventLogIf an application wants Express to redirect Logs to it's own Logging facility, then Express needed to be modified accordingly.
Express 6.1.0 decouples this hardcoded requirement by introducing the
Express.EventLogHandlerDelegate.A Xojo project using it can now specify which Method (that implements the delegate) an Express instance
should use as it's Event Log handler.
Usage:
Introduces: Express Demo GUI
This repository is now a MonoRepo containing two example projects:
Express-Demo-Console.xojo_projectExpress-Demo-GUI.xojo_projectThe new "Express Demo GUI" shows how to:
Express.RequestHandlerDelegateExpress.EventLogHandlerDelegateScreenShot:

Fixes: Multipart Forms Demo
The issue had been in the
Express.Request.Demos:
SpecialFolder.ResourcesA Copy File Post Build Step now copies the demo's ressources to the Resources Folder.
All Demos have been updated to look for the resources in
SpecialFolder.Resources.Note: The Multipart Forms Upload will go into the following folder
Demos have been updated with Nil checks for Request.Server (which is a WeakRef).
Server might be Nil if stopped while Request is still alive.
Breaking Changes | Update from 6.0 to 6.1
None.
If you don't assign an own Event Log Handler (see above), then Express will continue to use it's default logging mechanism.