generated from cloudwego/.github
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: add adaptor README.md * chore: adjust note
- Loading branch information
1 parent
4a8bbab
commit 132324b
Showing
2 changed files
with
15 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## Note: | ||
|
||
- When modifying the resp header in the server handler, please use `write` function to write the header. Otherwise, the modification will not take effect. | ||
|
||
```go | ||
func handler(resp http.ResponseWriter, req *http.Request) { | ||
resp.Header().Add("Content-Encoding", "test") | ||
_, err := resp.Write([]byte("Content-Encoding: test\n")) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} | ||
``` |
This file contains 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