mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-11 07:06:16 +01:00
Merge pull request #1281 from dmach/fix-POST-content-type
connection: Set Content-Type of POST requests without data to 'application/x-www-form-urlencoded'
This commit is contained in:
commit
2b852846f2
18
behave/features/checkconstraints.feature
Normal file
18
behave/features/checkconstraints.feature
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
Feature: `osc checkconstraints` command
|
||||||
|
|
||||||
|
|
||||||
|
# common steps for all scenarios
|
||||||
|
Background:
|
||||||
|
Given I set working directory to "{context.osc.temp}"
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Run `osc checkconstraints <project>/<package> <repository>/<arch>`
|
||||||
|
When I execute osc with args "checkconstraints test:factory/test-pkgA standard/x86_64"
|
||||||
|
Then the exit code is 0
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Run `osc checkconstraints` from a package working copy
|
||||||
|
Given I execute osc with args "co test:factory/test-pkgA"
|
||||||
|
And I set working directory to "{context.osc.temp}/test:factory/test-pkgA"
|
||||||
|
When I execute osc with args "checkconstraints"
|
||||||
|
Then the exit code is 0
|
@ -288,9 +288,10 @@ def http_request(method: str, url: str, headers=None, data=None, file=None):
|
|||||||
# https://github.com/openSUSE/open-build-service/pull/13019
|
# https://github.com/openSUSE/open-build-service/pull/13019
|
||||||
headers.add("Accept", "application/xml")
|
headers.add("Accept", "application/xml")
|
||||||
|
|
||||||
if data or file:
|
if method == "PUT" or (method == "POST" and (data or file)):
|
||||||
# osc/obs data is usually XML
|
|
||||||
headers.add("Content-Type", "application/xml; charset=utf-8")
|
headers.add("Content-Type", "application/xml; charset=utf-8")
|
||||||
|
elif method == "POST":
|
||||||
|
headers.add("Content-Type", "application/x-www-form-urlencoded")
|
||||||
|
|
||||||
if purl.scheme == "http" and HTTP_PROXY_MANAGER:
|
if purl.scheme == "http" and HTTP_PROXY_MANAGER:
|
||||||
# HTTP proxy requires full URL with 'same host' checking off
|
# HTTP proxy requires full URL with 'same host' checking off
|
||||||
|
Loading…
Reference in New Issue
Block a user