swagger-api / swagger-api/swagger-ui
Chrome overrides User-Agent specified as parameter
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A (please complete the following information)
- OS: macOS
- Browser: chrome
- Browser Version: 70.0.3538.77
- Method of installation: dist assets
- Swagger-UI version: 3.19.5
- Swagger/OpenAPI version: Swagger 2.0
Content & configuration
Example Swagger/OpenAPI definition:
- name: "User-Agent"
in: "header"
description: "user agent"
required: true
type: "string"
default: "CustomAgent"
Swagger-UI configuration options:
window.onload = function() {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
url: "swagger.yaml",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
})
// End Swagger UI call region
window.ui = ui
}
Describe the bug you're encountering
Browser always overrides User-Agent header and sends its own, no matter what value I type into parameter
To reproduce...
Steps to reproduce the behavior:
- Go to method with User-Agent parameter
- Click on Execute
Expected behavior
Request is sent with User-Agent equal to specified parameter
Actual behavior
Request is sent with standard browser User-Agent
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in Chrome using the supplied Swagger 2.0 definition and Swagger UI configuration, then inspect the request generated after clicking Execute. Trace the request execution path to determine where the entered User-Agent value is handled, and verify the result against the stated expected and actual behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100