Comments (6)
Hi @rojosinalma,
Thanks for reaching out!
The gateway respects the Accept-Encoding
header in the request. You can try setting it to identity
in your requests to disable compression.
Let me know if you need more help
from gateway.
Thanks for explaining, but I still don't fully understand how is what you mentioned going to bypass what's hardcoded in the block I posted.
Could you give me more information please?
from gateway.
Hey @rojosinalma - The compress middleware code that you have pointed out is written in a way that it will only do compress if the Accept-Encoding has a compression technique mentioned in it or if the code itself imposes a compress technique. In the case of gateway, we have not mentioned any compression technique, so it will rely on Accept-Encoding header. So if you send Accept-Encoding as identity, then it will not apply any compression on response. I hope this helps.
from gateway.
from gateway.
The same link that you have shared contains this info: https://hono.dev/middleware/builtin/compress#options
The compression scheme to allow for response compression. Either gzip or deflate. If not defined, both are allowed and will be used based on the Accept-Encoding header. gzip is prioritized if this option is not provided and the client provides both in the Accept-Encoding header.
Here it is mentioned that Accept-Encoding header is used to determine the type of response compression. So if you do not send it, then hono will not compress it.
Regarding the identity
value for accept-encoding, its a HTTP standard that is also mentioned in MDN web docs. So you can either remove accept-encoding from request header or send it as identity to inform server to not apply the compression. Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding#identity
When you send the header as identity, the code that is written inside hono compress middleware will not find any encoding and gateway also does not pass any default encoding method, so it will skip compressing the response. Here is the code for hono compress middleware: https://github.com/honojs/hono/blob/main/src/middleware/compress/index.ts
from gateway.
from gateway.
Related Issues (20)
- [Provider] Huggingface Text Embeddings Inference
- [Docs & Revamped Issues] HOT 1
- Chore: Add @portkey-ai/mustache package for prompt render
- Enhancement: Respect usage tokens for anthropic messages response
- allow multiple user messages in a row for google gemini
- Code cleaning and refactoring - Phase 1
- Missing `Makefile`? HOT 8
- Support portkey-default for model params value to pick up gateway default param value
- Feature comparison table
- Misleading HTTP 200 Status Code on Network Connection Lost Error via Portkey
- Add prettier setup and github action
- Feat: Support Bedrock mistral models HOT 1
- Feat: AzureOpenAI image generations first class support
- Add MonsterAPI provider
- [Provider] Voyage AI
- [Feature] API version should be dynamic ?
- Provider: Add jina integration
- Readme revamp - restructure + adding Python notebook
- Readme fix - new GIF & updated code snippet
- Request to stream a chat completion results in buffered response instead of stream
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gateway.