-
Notifications
You must be signed in to change notification settings - Fork 192
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
New reports from Webcompat.com does not automatically assign browser labels #2580
Comments
houla o_0 @miketaylr the modifications from the pull request #2573 seems innocuous. |
Thanks a lot @reinhart1010 for raising this issue. |
ok I think I understood.
gives HTTP/1.1 404 NOT FOUND
Connection: keep-alive
Content-Encoding: gzip
Content-Security-Policy: default-src 'self'; object-src 'none'; connect-src 'self' https://api.github.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' https://www.google-analytics.com https://*.githubusercontent.com data:; manifest-src 'self'; script-src 'self' https://www.google-analytics.com https://api.github.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; base-uri 'self'; frame-ancestors 'self'; report-uri /csp-report
Content-Type: text/html; charset=utf-8
Date: Mon, 17 Sep 2018 00:33:36 GMT
Server: nginx/1.1.19
Strict-Transport-Security: max-age=31536000; includeSubDomains;
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block By removing the blueprint I also removed the knowledge of the route from the main code. Rha. So let's revert until I figure a way to do this in another way. |
We know the route should listen only to POST.
HTTP/1.0 405 METHOD NOT ALLOWED
Allow: HEAD, OPTIONS, GET
Content-Length: 178
Content-Security-Policy: default-src 'self'; object-src 'none'; connect-src 'self' https://api.github.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' https://webcompat.com https://www.google-analytics.com https://*.githubusercontent.com data:; manifest-src 'self'; script-src 'self' https://www.google-analytics.com https://api.github.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; base-uri 'self'; frame-ancestors 'self'; report-uri /csp-report
Content-Type: text/html
Date: Mon, 17 Sep 2018 00:44:31 GMT
Server: Werkzeug/0.14.1 Python/2.7.10
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p> Let's try to fix something. diff --git a/webcompat/__init__.py b/webcompat/__init__.py
index 8bd123f..19927a0 100644
--- a/webcompat/__init__.py
+++ b/webcompat/__init__.py
@@ -28,6 +28,7 @@ limiter = Limiter(app, key_func=get_remote_address)
# import views after we initialize our github object
import webcompat.views # nopep8
+import webhooks # nopep8
# register blueprints
from api.endpoints import api Let's redo the HTTP request
HTTP/1.0 401 UNAUTHORIZED
Content-Length: 19
Content-Security-Policy: default-src 'self'; object-src 'none'; connect-src 'self' https://api.github.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' https://webcompat.com https://www.google-analytics.com https://*.githubusercontent.com data:; manifest-src 'self'; script-src 'self' https://www.google-analytics.com https://api.github.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; base-uri 'self'; frame-ancestors 'self'; report-uri /csp-report
Content-Type: text/plain
Date: Mon, 17 Sep 2018 01:04:03 GMT
Server: Werkzeug/0.14.1 Python/2.7.10
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Nothing to see here Yeah working. Let's create a test for this.
with diff --git a/tests/unit/test_urls.py b/tests/unit/test_urls.py
index cab3f24..204e226 100644
--- a/tests/unit/test_urls.py
+++ b/tests/unit/test_urls.py
@@ -240,6 +240,16 @@ class TestURLs(unittest.TestCase):
self.assertTrue('text/html' in rv.content_type)
self.assertTrue(content_test)
+ def test_webhooks_route(self):
+ """Request to /webhooks/labeler should be 401.
+
+ Without identification it sends a 401, and also proves the route exists.
+ """
+ rv = self.app.post('/webhooks/labeler')
+ content_test = 'Nothing to see here' in rv.data
+ self.assertEqual(rv.status_code, 401)
+ self.assertTrue('text/plain' in rv.content_type)
+ self.assertTrue(content_test)
if __name__ == '__main__':
unittest.main()
diff --git a/webcompat/__init__.py b/webcompat/__init__.py
index 8bd123f..19927a0 100644
--- a/webcompat/__init__.py
+++ b/webcompat/__init__.py
@@ -28,6 +28,7 @@ limiter = Limiter(app, key_func=get_remote_address)
# import views after we initialize our github object
import webcompat.views # nopep8
+import webhooks # nopep8
# register blueprints
from api.endpoints import api Let's create a pull request for this. |
No need to revert. |
This one is occuring again, starting from webcompat/web-bugs#19398 |
@reinhart1010 see #2644 |
Starting from webcompat/web-bugs#18835, there are no browser tags such as
browser-firefox
assigned automatically. This might be related to #2573.The text was updated successfully, but these errors were encountered: