Skip to content
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

Modify POST requests, but only for certain hosts #435

Open
suzukieng opened this issue Nov 25, 2019 · 0 comments
Open

Modify POST requests, but only for certain hosts #435

suzukieng opened this issue Nov 25, 2019 · 0 comments

Comments

@suzukieng
Copy link

suzukieng commented Nov 25, 2019

I have the following problem: For certain hosts, I'd like to access POST request data and respond with a response directly ("short-circuit response").

I know it can be achieved by returning a positive buffer size in getMaximumRequestBufferSizeInBytes(), but from my understanding this will prevent the user from uploading data larger than said size. The POST requests I'm interested in are a few kilobytes in size, and are only destined for a certain host. All the other POST requests I'm not interested in and I'd just like to stream-through, without buffering.

From my understanding of the interaction between LittleProxy and Netty this can not be achieved, as the content aggregation (instantiation of HttpObjectAggregator and adding it to pipeline) is configured on the channel basis and not per-request. At channel initialization time we don't know the target host because it is contained in the request. Also, the channel represents the client-to-proxy TCP connection, which i believe can persist over several requests (keep-alive) and possibly over multiple target hosts (I'm unsure about the last one, but can't rule it out)?

Is there some other way to achieve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant