-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service Worker version reported is inaccurate #831
Comments
This is likely due to there being two Server HTTP response headers:
The first one ought to be suppressed. |
In replay.py:
...this header is being overwritten but for some reason is instead being appended. |
|
The homepage is invoked via |
It appears that Flask automatically wraps the returned string of |
Wrapping the string in a make_response-generated response object and returning that still produces the Other headers (e.g., 'Foo') can be set here and are displayed in the response but |
I am wondering if this behavior is new to Werkzeug 3, which was released in September 2023. EDIT: Werkzeug==2.3.8 has two headers as well. Maybe try an older version of Flask (currently on Flask v. 2.3.2) |
Note, this issue is also present in the HTTP response headers for mementos, so adjusting it in |
MWE: from flask import (
Flask, make_response
)
app = Flask(__name__)
@app.route('/')
def home():
resp = make_response('lorem ipsum')
resp.headers['Server'] = "My Server"
return resp
app.run() % curl -I http://127.0.0.1:5000
HTTP/1.1 200 OK
Server: Werkzeug/3.0.3 Python/3.12.0
Date: Fri, 24 May 2024 15:35:37 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 11
Server: My Server
Connection: close |
I asked about this on the Pallets Discord. |
It is sounding like it is not possible. Perhaps we can store the IPWB version in another header and reference it. |
Other advice from Discord:
|
The JS fetch to get the server headers combines both server headers into one string with a space delimitation. I am not sure whether having two Server response headers is valid. Regardless, the logic to extract the ipwb version needs to not look at the element at index 1 but instead |
Current master branch head abaa35a
In Options and Details, the Service Worker is reported as "ver. 3.0.1 Python".
![sw](https://private-user-images.githubusercontent.com/2514780/333630518-3b3ae1dd-788b-40ac-87a8-eba9e4dda70e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NDgwMTUsIm5iZiI6MTczOTU0NzcxNSwicGF0aCI6Ii8yNTE0NzgwLzMzMzYzMDUxOC0zYjNhZTFkZC03ODhiLTQwYWMtODdhOC1lYmE5ZTRkZGE3MGUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTRUMTU0MTU1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2YxYTIwMzliZDViZGVhZDNhNTBjYWUwOTk5YzI1NDE1MTU5ZmExNzU1YmZkM2IwYmE2M2MwMzNmYzNlNzdhMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.3kSydjqO4vrZlfUjT9KScpDL1ji5S5ca4MkbYi_scLM)
The basis of this looks to be parsed from the Server header via webui.js.
The text was updated successfully, but these errors were encountered: