Giter Club home page Giter Club logo

Comments (12)

silvioprog avatar silvioprog commented on July 19, 2024

Friend, you can close this issue. It's OK, and thank you very much! 👍

from brookframework.

uaply avatar uaply commented on July 19, 2024

The same procedure HandleUnknownEncoding is repeated in all routers with exactly the same source code. Maybe we should move out this functionality in some common helper function?
It will be something like

procedure TBrookHTTPConnectionRequest.HandleUnknownEncoding(const AContentType: string;
  AStream: TStream);
begin
   HandleUnknownEncodingHelper(Self, AContentType, AStream);
end;

What do you think?

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

You can create it and send to the working branch, so we can test it.

ps. I'm testing all your changes in router. ;)

from brookframework.

uaply avatar uaply commented on July 19, 2024

What file should we place this new function? Create a new broker-helper unit, or somewhere in the 'core'?

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

You can create a new unit called as BrookHTTPDefsBroker or other better name, and paste all your shared broker functions there.

from brookframework.

uaply avatar uaply commented on July 19, 2024

Ok! I think Page404 and Page500 handlers also could be moved there.

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

Very nice!

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

You're working on it? After we close this issue, I'll do a merge to master. 👍

from brookframework.

uaply avatar uaply commented on July 19, 2024

I'm stuck with inheritance problem. Trying to find a solution.

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

Tell me about it. :)

from brookframework.

uaply avatar uaply commented on July 19, 2024

We need to override virtual method HandleUnknownEncoding()
But all three our brokers inherits from different childs of TRequest:
HTTPApp Broker: TFPHTTPConnectionRequest
CGI Broker: TCGIRequest
FastCGI Broker: TFCGIRequest

We can't make common child TBrookRequest and override HandleUnknownEncoding() method here, because each application needs its own parent class.

So I moved functionality to external functions, and forced to pass original object as argument. Not very nice solution, I'm not sure it is better than was before.

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

Yeah, that's why I implemented separately. :)

Another detail, might happen a broker to need a specific change. But this is not the case, we keep as you already did, with functions.

Your code it's great, I made just a simple cleaning. Thank you very much! (now you can close this issue 👍 )

from brookframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.