Skip to content

Commit 673c646

Browse files
committed
[POP Gateway]feat: support host rewrite
1 parent 27de36f commit 673c646

File tree

9 files changed

+12
-14
lines changed

9 files changed

+12
-14
lines changed

alibabacloud-gateway-pop/csharp/core/Client.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ public string BuildCanonicalizedHeaders(Dictionary<string, string> headers)
582582
string value = headers.Get(key);
583583
if (!AlibabaCloud.TeaUtil.Common.IsUnset(value))
584584
{
585-
if (!AlibabaCloud.DarabonbaString.StringUtil.Contains(tmp, lowerKey))
585+
if (!AlibabaCloud.DarabonbaString.StringUtil.Contains(tmp, lowerKey) || AlibabaCloud.DarabonbaString.StringUtil.Equals(lowerKey, "host"))
586586
{
587587
tmp = "" + tmp + "," + lowerKey;
588588
newHeaders[lowerKey] = AlibabaCloud.DarabonbaString.StringUtil.Trim(value);

alibabacloud-gateway-pop/csharp/core/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
// Build Number
3030
// Revision
3131
//
32-
[assembly: AssemblyVersion("0.1.0.0")]
33-
[assembly: AssemblyFileVersion("0.1.0.0")]
32+
[assembly: AssemblyVersion("0.1.1.0")]
33+
[assembly: AssemblyFileVersion("0.1.1.0")]

alibabacloud-gateway-pop/golang/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ func (client *Client) BuildCanonicalizedHeaders(headers map[string]*string) (_re
425425
lowerKey := string_.ToLower(key)
426426
value := headers[tea.StringValue(key)]
427427
if !tea.BoolValue(util.IsUnset(value)) {
428-
if !tea.BoolValue(string_.Contains(tmp, lowerKey)) {
428+
if !tea.BoolValue(string_.Contains(tmp, lowerKey)) || tea.BoolValue(string_.Equals(lowerKey, tea.String("host"))) {
429429
tmp = tea.String(tea.StringValue(tmp) + "," + tea.StringValue(lowerKey))
430430
newHeaders[tea.StringValue(lowerKey)] = string_.Trim(value)
431431
} else {

alibabacloud-gateway-pop/java/src/main/java/com/aliyun/gateway/pop/Client.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ public String buildCanonicalizedHeaders(java.util.Map<String, String> headers) t
320320
String lowerKey = com.aliyun.darabonbastring.Client.toLower(key);
321321
String value = headers.get(key);
322322
if (!com.aliyun.teautil.Common.isUnset(value)) {
323-
if (!com.aliyun.darabonbastring.Client.contains(tmp, lowerKey)) {
323+
if (!com.aliyun.darabonbastring.Client.contains(tmp, lowerKey) || com.aliyun.darabonbastring.Client.equals(lowerKey, "host")) {
324324
tmp = "" + tmp + "," + lowerKey + "";
325325
newHeaders.put(lowerKey, com.aliyun.darabonbastring.Client.trim(value));
326326
} else {

alibabacloud-gateway-pop/main.tea

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ function buildCanonicalizedHeaders(headers: map[string]string): string {
305305
var lowerKey = String.toLower(key);
306306
var value = headers[key];
307307
if (!Util.isUnset(value)) {
308-
if (!String.contains(tmp, lowerKey)) {
308+
if (!String.contains(tmp, lowerKey) || String.equals(lowerKey, 'host')) {
309309
tmp = `${tmp},${lowerKey}`;
310310
newHeaders[lowerKey] = String.trim(value);
311311
} else {

alibabacloud-gateway-pop/php/src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ public function buildCanonicalizedHeaders($headers)
398398
$lowerKey = StringUtil::toLower($key);
399399
$value = @$headers[$key];
400400
if (!Utils::isUnset($value)) {
401-
if (!StringUtil::contains($tmp, $lowerKey)) {
401+
if (!StringUtil::contains($tmp, $lowerKey) || StringUtil::equals($lowerKey, "host")) {
402402
$tmp = "" . $tmp . "," . $lowerKey . "";
403403
$newHeaders[$lowerKey] = StringUtil::trim($value);
404404
} else {

alibabacloud-gateway-pop/python/alibabacloud_gateway_pop/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ def build_canonicalized_headers(
466466
lower_key = StringClient.to_lower(key)
467467
value = headers.get(key)
468468
if not UtilClient.is_unset(value):
469-
if not StringClient.contains(tmp, lower_key):
469+
if not StringClient.contains(tmp, lower_key) or StringClient.equals(lower_key, 'host'):
470470
tmp = f'{tmp},{lower_key}'
471471
new_headers[lower_key] = StringClient.trim(value)
472472
else:

alibabacloud-gateway-pop/python/setup.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"""
2525
setup module for alibabacloud_gateway_pop.
2626
27-
Created on 11/11/2025
27+
Created on 25/11/2025
2828
2929
@author: Alibaba Cloud SDK
3030
"""
@@ -70,19 +70,17 @@
7070
include_package_data=True,
7171
platforms="any",
7272
install_requires=REQUIRES,
73-
python_requires=">=3.7",
73+
python_requires=">=3.6",
7474
classifiers=(
7575
"Development Status :: 4 - Beta",
7676
"Intended Audience :: Developers",
7777
"License :: OSI Approved :: Apache Software License",
7878
"Programming Language :: Python",
7979
"Programming Language :: Python :: 3",
80+
"Programming Language :: Python :: 3.6",
8081
'Programming Language :: Python :: 3.7',
8182
'Programming Language :: Python :: 3.8',
8283
'Programming Language :: Python :: 3.9',
83-
'Programming Language :: Python :: 3.10',
84-
'Programming Language :: Python :: 3.11',
85-
'Programming Language :: Python :: 3.12',
8684
"Topic :: Software Development"
8785
)
8886
)

alibabacloud-gateway-pop/ts/src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ export default class Client extends SPI {
330330
let lowerKey = String.toLower(key);
331331
let value = headers[key];
332332
if (!Util.isUnset(value)) {
333-
if (!String.contains(tmp, lowerKey)) {
333+
if (!String.contains(tmp, lowerKey) || String.equals(lowerKey, "host")) {
334334
tmp = `${tmp},${lowerKey}`;
335335
newHeaders[lowerKey] = String.trim(value);
336336
} else {

0 commit comments

Comments
 (0)