Software: Openproject,Gogs(internal Github clone)
Description: I send push notification from Gogs to openproject/webhooks/github, and getting 403 empty body.
Redacted information: apikey=42, "user.user", "user.user.com"
Send Headers:
Request URL: http://192.168.100.100/openproject/webhooks/github?apikey=42 Request method: POST Content-Type: application/json X-Github-Delivery: 92b7ff07-79b4-4334-b0b5-59122bedc9e7 X-Github-Event: pull_request X-Gogs-Delivery: 92b7ff07-79b4-4334-b0b5-59122bedc9e7 X-Gogs-Event: pull_request X-Gogs-Signature:
Send Body:
{ "action": "opened", "number": 4, "pull_request": { "id": 8, "number": 4, "user": { "id": 1, "username": "user.user", "login": "user.user", "full_name": "", "email": "user#user.com", "avatar_url": "http://192.168.100.100:3000/avatars/1" }, "title": "OP#48", "body": "[#48] [MFK5] [FuSa] [X120] SAF-4.2 :: SDD update\r\n\r\nhttp://192.168.100.100/openproject/work_packages/48\r\n", "labels": [], "milestone": null, "assignee": null, "state": "open", "comments": 0, "head_branch": "task/48-mfk5-fusa-x120-saf-42-sdd-update", "head_repo": { "id": 5, "owner": { "id": 13, "username": "DevTeam", "login": "DevTeam", "full_name": "", "email": "", "avatar_url": "http://192.168.100.100:3000/avatars/13" }, "name": "testpublic", "full_name": "DevTeam/testpublic", "description": "", "private": false, "fork": false, "parent": null, "empty": false, "mirror": false, "size": 49152, "html_url": "http://192.168.100.100:3000/DevTeam/testpublic", "ssh_url": "git#localhost:DevTeam/testpublic.git", "clone_url": "http://192.168.100.100:3000/DevTeam/testpublic.git", "website": "", "stars_count": 0, "forks_count": 0, "watchers_count": 4, "open_issues_count": 0, "default_branch": "master", "created_at": "2022-12-21T16:42:20+01:00", "updated_at": "2023-01-25T12:00:47+01:00" }, "base_branch": "master", "base_repo": { "id": 5, "owner": { "id": 13, "username": "DevTeam", "login": "DevTeam", "full_name": "", "email": "", "avatar_url": "http://192.168.100.100:3000/avatars/13" }, "name": "testpublic", "full_name": "DevTeam/testpublic", "description": "", "private": false, "fork": false, "parent": null, "empty": false, "mirror": false, "size": 49152, "html_url": "http://192.168.100.100:3000/DevTeam/testpublic", "ssh_url": "git#localhost:DevTeam/testpublic.git", "clone_url": "http://192.168.100.100:3000/DevTeam/testpublic.git", "website": "", "stars_count": 0, "forks_count": 0, "watchers_count": 4, "open_issues_count": 0, "default_branch": "master", "created_at": "2022-12-21T16:42:20+01:00", "updated_at": "2023-01-25T12:00:47+01:00" }, "html_url": "http://192.168.100.100:3000/DevTeam/testpublic/pulls/4", "mergeable": true, "merged": false, "merged_at": null, "merge_commit_sha": null, "merged_by": null }, "repository": { "id": 5, "owner": { "id": 13, "username": "DevTeam", "login": "DevTeam", "full_name": "", "email": "", "avatar_url": "http://192.168.100.100:3000/avatars/13" }, "name": "testpublic", "full_name": "DevTeam/testpublic", "description": "", "private": false, "fork": false, "parent": null, "empty": false, "mirror": false, "size": 49152, "html_url": "http://192.168.100.100:3000/DevTeam/testpublic", "ssh_url": "git#localhost:DevTeam/testpublic.git", "clone_url": "http://192.168.100.100:3000/DevTeam/testpublic.git", "website": "", "stars_count": 0, "forks_count": 0, "watchers_count": 4, "open_issues_count": 0, "default_branch": "master", "created_at": "2022-12-21T16:42:20+01:00", "updated_at": "2023-01-25T12:00:47+01:00" }, "sender": { "id": 1, "username": "user.user", "login": "user.user", "full_name": "", "email": "user#user.com", "avatar_url": "http://192.168.100.100:3000/avatars/1" } }
Response Headers: "403"
Cache-Control: max-age=0, private, must-revalidate Content-Security-Policy: default-src 'self'; base-uri 'self'; connect-src 'self' https://augur.openproject.com; font-src 'self' data:; form-action 'self'; frame-ancestors 'self'; frame-src 'self' https://player.vimeo.com https://releases.openproject.com/v1/check.svg; img-src * data: blob:; media-src 'self'; object-src https://releases.openproject.com/v1/check.svg; script-src 'self'; style-src 'self' 'unsafe-inline' Content-Type: text/html Date: Wed, 25 Jan 2023 11:02:22 GMT Referrer-Policy: origin-when-cross-origin Server: Apache/2.4.52 (Ubuntu) Set-Cookie: _open_project_session=c989eaa3af4d5d6b19c75b52899fa9ae; path=/openproject; HttpOnly; SameSite=Lax Vary: Accept-Encoding X-Content-Type-Options: nosniff X-Download-Options: noopen X-Frame-Options: SAMEORIGIN X-Permitted-Cross-Domain-Policies: none X-Request-Id: f1905295-06d6-4770-b046-2fd51147fadf X-Runtime: 0.008078 X-Xss-Protection: 1; mode=block
Response Body:
Api Key is valid, tested on API section using Postman. I can understand that some settings in Gogs can be an issue, like:
X-Gogs-Delivery: X-Gogs-Event: X-Gogs-Signature:
But i have no return information to proceed.
Related
I am trying to get button's link from message of gmail (ex. verify account button). Is there any way to make it via Google API?
I used Api to get all messages first: https://www.googleapis.com/gmail/v1/users/me/messages
Then used this api to get the message details: https://www.googleapis.com/gmail/v1/users/me/messages/{message_id}
but can't find the link inside the email body, here is the response!!
{
"id": "1785a64978e454be",
"threadId": "1785a528dc1e905c",
"labelIds": [
"IMPORTANT",
"CATEGORY_PERSONAL",
"INBOX"
],
"snippet": "Invesna Logo Hello Turki Thank you for joining our community Best wishes INVESNA Team Verify Now This is an automated email. If you've received this email by mistake, please",
"payload": {
"partId": "",
"mimeType": "multipart/alternative",
"filename": "",
"headers": [
{
"name": "Delivered-To",
"value": "areeb.*****#gmail.com"
},
{
"name": "Received",
"value": "by 2002:a6b:916:0:0:0:0:0 with SMTP id t22csp3887526ioi; Mon, 22 Mar 2021 07:44:05 -0700 (PDT)"
},
{
"name": "X-Google-Smtp-Source",
"value": "ABdhPJyvgEKiYNby+5oLp9d6ZLU4ujfWHmppkGFvw2POAHup5hfkbaexaDRj9bwjk1zLmhyuIfsq"
},
{
"name": "X-Received",
"value": "by 2002:ac8:4752:: with SMTP id k18mr234477qtp.158.1616424245098; Mon, 22 Mar 2021 07:44:05 -0700 (PDT)"
},
{
"name": "ARC-Seal",
"value": "i=1; a=rsa-sha256; t=1616424245; cv=none; d=google.com; s=arc-20160816; b=cTBJJWs+fBO2mU4nAKoz+VzfvNI7RrAW3PKApijZ0LI4v6Ma1XAQxKilc+IEiwcmFE D6cTkU9CVAS9f+IOaE3bb8NCnQVz7mFvFkD72vvDeWaMsW2V2jbKZoFPdFKDGZ6b70fq WUXxy5uCHkafF9gAtmPFU2eTfMRRk5uv3ZA8XGcO87JWSYngzz/DoOdD6cQOVfIiv4HF YGAITJGHTYL2kgwdRVlSJCKQBpQZIJqM3pUHaYJ3+uXs2rg1XkaLyFudF3brG7tKUOMN gCXsyINhAfuTw2bIrWmSX+8B3AHG+h+aQfTbl9GNr3oBLYYM7BRMSfG2S8jldm6XnEpM ZUEg=="
},
{
"name": "ARC-Message-Signature",
"value": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:mime-version:to:from:subject:date:message-id :dkim-signature:dkim-signature; bh=RToLBuWpZqa2f+3AtVt2tvS0pNeSTnAA4DQnGQ8mMWU=; b=prTkhBY/VOg77E8LDGE3HZD7rGb2vQuG2uln53Jh3ee4fXIKZtB6RwVUjBrodFyb6S FXUbY0Iox/TWv+Maqr0p89waYhGYy/aQD4g6G3/8BwLSCqAOc65JsKMGwGor/t2ZdsOZ w97c2w3eswYEfu9FuhXyCLV9Jbg/4bw32JWb59mKuAQSKx6aeiipXShmPmAmI5FWxlmu y/dbft5H4weUd3jXQjbAqXnfzyEso+nbl2iexfobZ4vqRPzarwk9tSZEC73mgqbsA5ZF zx9xPOYxJbMVin5Wrsit0p8xVv3DD1UlPGqNCItAviqUkHqtUDkznPmiWpFXtXLxoyk2 3SyA=="
},
{
"name": "ARC-Authentication-Results",
"value": "i=1; mx.google.com; dkim=pass header.i=#areebgroup.com header.s=ly5fxy3f4dncdbipp3gron65eulkyt3p header.b=XztlZ3Jb; dkim=pass header.i=#amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=FtocR6ro; spf=pass (google.com: domain of 010001785a649518-d06bf9df-a011-4cee-81ed-9328a70eaa39-000000#amazonses.com designates 54.240.48.108 as permitted sender) smtp.mailfrom=010001785a649518-d06bf9df-a011-4cee-81ed-9328a70eaa39-000000#amazonses.com"
},
{
"name": "Return-Path",
"value": "<010001785a649518-d06bf9df-a011-4cee-81ed-9328a70eaa39-000000#amazonses.com>"
},
{
"name": "Received",
"value": "from a48-108.smtp-out.amazonses.com (a48-108.smtp-out.amazonses.com. [54.240.48.108]) by mx.google.com with ESMTPS id cj6si7995790qvb.74.2021.03.22.07.44.04 for <areeb.testing2#gmail.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Mon, 22 Mar 2021 07:44:05 -0700 (PDT)"
},
{
"name": "Received-SPF",
"value": "pass (google.com: domain of 010001785a649518-d06bf9df-a011-4cee-81ed-9328a70eaa39-000000#amazonses.com designates 54.240.48.108 as permitted sender) client-ip=54.240.48.108;"
},
{
"name": "Authentication-Results",
"value": "mx.google.com; dkim=pass header.i=#areebgroup.com header.s=ly5fxy3f4dncdbipp3gron65eulkyt3p header.b=XztlZ3Jb; 18-d06bf9df-a011-4cee-81ed-9328a70eaa39-000000#amazonses.com"
},
{
"name": "DKIM-Signature",
"value": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ly5fxy3f4dncdbipp3gron65eulkyt3p; d=areebgroup.com; t=1616424244; h=Message-ID:Date:Subjec"
},
{
"name": "DKIM-Signature",
"value": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1616424244; h=Message-ID:Date:Subject:Fro"
},
{
"name": "Message-ID",
"value": "<010001785>
},
{
"name": "Date",
"value": "Mon, 22 Mar 2021 14:44:04 +0000"
},
{
"name": "Subject",
"value": "Verify Your Account"
},
{
"name": "From",
"value": "Invesna <account#aree>"
},
{
"name": "To",
"value": "areeb.**#gmail.com"
},
{
"name": "MIME-Version",
"value": "1.0"
},
{
"name": "Content-Type",
"value": "multipart/alternative; boundary=\"_=_swift_1616424243_8452744c94a6060ff23d75c5b712dcb6_=_\""
},
{
"name": "X-SES-Outgoing",
"value": "2021.03.22-54.240.48.108"
},
{
"name": "Feedback-ID",
"value": "1.us-ea"
}
],
"body": {
"size": 0
},
"parts": [
{
"partId": "0",
"mimeType": "text/plain",
"filename": "",
"headers": [
{
"name": "Content-Type",
"value": "text/plain; charset=utf-8"
},
{
"name": "Content-Transfer-Encoding",
"value": "quoted-printable"
}
],
"body": {
"size": 5094,
"data": "PCFET0NUWVBFIGh0bWw-DQo8aHRtbCBsYW5nPSJlbiI-DQo8Ym9keT4NCjxkaXYgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmN2Y5ZmM7IHBhZGRpbmctYm90dG9tOiAzcmVtIj4NCiAgICA8aW1nIHNyYz0iaHR0cDovL2FwaS10ZXN0LmludmVzbmEud9JbnZlc25hX2FwcCIgdGFyZ2V0PSJfYmxhbmsiPg0KICAgICAgICAgICAgICAgICAgICAgICAgPGltZw0KICAgICAgICAgICAgPg0KPC9ib2R5Pg0KPC9odG1sPg0K"
}
},
{
"partId": "1",
"mimeType": "text/html",
"filename": "",
"headers": [
{
"name": "Content-Type",
"value": "text/html; charset=utf-8"
},
{
"name": "Content-Transfer-Encoding",
"value": "quoted-printable"
}
],
"body": {
"size": 10026,
"data": "PCFkb2N0eXBlIGh0bWw-DQo8aHRtbCBsYW5nPSJlbiI-PGJvZHkgc3R5bGU9ImZvbnQtZmFtaWx5OiAtYXBwbGUtc3lzdGVtLCBCbGlua01hY1N5c3RlbUZvbnQsICdTZWdvZSBVSScsIFJvYm90bywgSGVsdmV0aWNhLCBBcmlhbCwgc2Fucy1zZXJpZiwgJ0FwcGxlIENvbG9yIEVtb2ppgYWx0PSJQYXR0ZXJuIiBzdHlsZT0iZm9udC1mYW1pbHk6IC1hcHBsZS1zeXN0ZW0sICAgICAgPC91bD4NCjwvZGl2Pg0KICAgIDwvZGl2Pg0KPC9kaXY-DQo8L2JvZHk-PC9odG1sPg0K"
}
}
]
},
"sizeEstimate": 20887,
"historyId": "79",
"internalDate": "16164240"
}
Resolved, my email body was encoded by base64 encoder, i decode it first then i found the link i need
Reference:
Resource: MessagePartBody
we are receiving errors from the HERE map tiles rest API, but the error is only when trying to get the map tiles with a computer located in Florida. From a computer located in Israel, everything is fine.
Any known issue?
See below -
"_priority": "High",
"_resourceType": "image",
"cache": {},
"pageref": "page_1",
"request": {
"method": "GET",
"url": "https://3.aerial.maps.cit.api.here.com/maptile/2.1/maptile/newest/satellite.day/15/9050/13824/256/png8?app_id=XXX=eng",
"httpVersion": "",
"headers": [
{
"name": ":method",
"value": "GET"
},
{
"name": ":authority",
"value": "3.aerial.maps.cit.api.here.com"
},
{
"name": ":scheme",
"value": "https"
},
{
"name": ":path",
"value": "/maptile/2.1/maptile/newest/satellite.day/15/9050/13824/256/png8?app_id=XXX=eng"
},
{
"name": "user-agent",
"value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36"
},
{
"name": "accept",
"value": "image/avif,image/webp,image/apng,image/*,*/*;q=0.8"
},
{
"name": "sec-fetch-site",
"value": "cross-site"
},
{
"name": "sec-fetch-mode",
"value": "no-cors"
},
{
"name": "sec-fetch-dest",
"value": "image"
},
{
"name": "referer",
"value": "https://eu.percepto.co/"
},
{
"name": "accept-encoding",
"value": "gzip, deflate, br"
},
{
"name": "accept-language",
"value": "en-US,en;q=0.9"
}
],
"queryString": [
{
"name": "app_id",
"value": "XXX"
},
{
"name": "app_code",
"value": "XXX"
},
{
"name": "lg",
"value": "eng"
}
],
"cookies": [],
"headersSize": -1,
"bodySize": 0
},
"response": {
"status": 0,
"statusText": "",
"httpVersion": "",
"headers": [],
"cookies": [],
"content": {
"size": 0,
"mimeType": "x-unknown"
},
"redirectURL": "",
"headersSize": -1,
"bodySize": -1,
"_transferSize": 0,
"_error": "net::ERR_ABORTED"
},
"serverIPAddress": "",
"startedDateTime": "2020-11-30T18:10:30.325Z",
"time": 1.3352910000830889,
"timings": {
"blocked": 1.3352910000830889,
"dns": -1,
"ssl": -1,
"connect": -1,
"send": 0,
"wait": 0,
"receive": 0,
"_blocked_queueing": -1
}
},
Sometimes HERE services are down in some region and you can see the status of the services at this link:
HERE System Status
I am working on a Shopify React Native app. I am trying to create a new customer with my app. It is working fine on Postman but not working with my app.
app.
I have also setup my private app on shopify and get all the required credentials from there.
I am posting my code here.
let requestdata =
{
method: 'POST',
headers:
{
'Authorization':'Basic ' + base64.encode('apikey' + ":" +
'password'),
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"customer": {
"first_name": "test",
"last_name": "user",
"email": "testuser#example.com",
"phone": "+15154346011",
"verified_email": true,
"addresses": [
{
"address1": "123 Oak St",
"city": "Ottawa",
"province": "ON",
"phone": "+15154346011",
"zip": "123 ABC",
"last_name": "user",
"first_name": "test",
"country": "CA"
}
]
}}),
};
fetch('https://apikey:password#domainname/admin/api/2020-
04/customers.json', requestdata)
.then(res => {
console.log("resoponse",JSON.stringify(res))
this.setState({
data:res
})
}).catch((err)=>{
console.log(err)
})
}
Here i am also attaching image of response i am getting.
{
"type": "default",
"status": 200,
"ok": true,
"headers": {
"map": {
"referrer-policy": "origin-when-cross-origin",
"cache-control": "no-cache, no-store",
"x-request-id": "fe78c2cb-1f8e-4cbc-815b-7a9aef11145e",
"cf-request-id": "0344067c9e00000f82b3286200000001",
"set-cookie": "_y=5de13f45-35f4-46a9-92f2-502b08a7ab8e; Expires=Fri, 11-Jun-21 08:09:37 GMT; Path=/, request_method=; path=/; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT, _shopify_y=5de13f45-35f4-46a9-92f2-502b08a7ab8e; Expires=Fri, 11-Jun-21 08:09:37 GMT; Path=/",
"x-shardid": "41",
"x-shopify-login-required": "true",
"expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
"x-dc": "gcp-us-east1,gcp-us-central1,gcp-us-central1",
"x-xss-protection": "1; mode=block; report=/xss-report?source%5Baction%5D=login&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fauth&source%5Bsection%5D=admin&source%5Buuid%5D=fe78c2cb-1f8e-4cbc-815b-7a9aef11145e",
"x-sorting-hat-podid": "41",
"content-type": "text/html; charset=utf-8",
"x-frame-options": "DENY",
"x-download-options": "noopen",
"vary": "Accept-Encoding",
"date": "Thu, 11 Jun 2020 08:09:37 GMT",
"nel": "{\"report_to\":\"network-errors\",\"max_age\":2592000,\"failure_fraction\":0.01,\"success_fraction\":0.0001}, {\"report_to\":\"network-errors\",\"max_age\":2592000,\"failure_fraction\":0.01,\"success_fraction\":0.0001}",
"server": "cloudflare",
"x-content-type-options": "nosniff",
"x-shopify-stage": "production",
"report-to": "{\"group\":\"network-errors\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://monorail-edge.shopifycloud.com/v1/reports/nel/20190325/shopify\"}]}, {\"group\":\"network-errors\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://monorail-edge.shopifycloud.com/v1/reports/nel/20190325/shopify\"}]}",
"cf-cache-status": "DYNAMIC",
"alt-svc": "h3-27=\":443\"; ma=86400",
"x-shopid": "27371339818",
"shopify-auth-mechanisms": "password",
"content-language": "en",
"cf-ray": "5a19d9da9dab0f82-MXP",
"x-sorting-hat-shopid": "27371339818"
}
},
"url": "https://apikey:password#domainname.myshopify.com/admin/auth/login",
"_bodyInit": {
"_data": {
"size": 1323,
"offset": 0,
"blobId": "0e0582a6-41ee-4cac-a1c4-b651149cc87f",
"__collector": {}
}
},
"_bodyBlob": {
"_data": {
"size": 1323,
"offset": 0,
"blobId": "0e0582a6-41ee-4cac-a1c4-b651149cc87f",
"__collector": {}
}
}
}
And this is the response i am getting from postman:
{
"customer": {
"id": 3028204847146,
"email": "testuser#example.com",
"accepts_marketing": false,
"created_at": "2020-06-14T15:59:02+05:30",
"updated_at": "2020-06-14T15:59:02+05:30",
"first_name": "test",
"last_name": "user",
"orders_count": 0,
"state": "disabled",
"total_spent": "0.00",
"last_order_id": null,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": "+15154346011",
"tags": "",
"last_order_name": null,
"currency": "INR",
"addresses": [
{
"id": 3226192674858,
"customer_id": 3028204847146,
"first_name": "test",
"last_name": "user",
"company": null,
"address1": "123 Oak St",
"address2": null,
"city": "Ottawa",
"province": "Ontario",
"country": "Canada",
"zip": "123 ABC",
"phone": "+15154346011",
"name": "test user",
"province_code": "ON",
"country_code": "CA",
"country_name": "Canada",
"default": true
}
],
"accepts_marketing_updated_at": "2020-06-14T15:59:02+05:30",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/3028204847146",
"default_address": {
"id": 3226192674858,
"customer_id": 3028204847146,
"first_name": "test",
"last_name": "user",
"company": null,
"address1": "123 Oak St",
"address2": null,
"city": "Ottawa",
"province": "Ontario",
"country": "Canada",
"zip": "123 ABC",
"phone": "+15154346011",
"name": "test user",
"province_code": "ON",
"country_code": "CA",
"country_name": "Canada",
"default": true
}
}
}
I'm using GraphQL.Net and getting the following when trying to use the API.
{
"version": {
"major": 1,
"minor": 1,
"build": -1,
"revision": -1,
"majorRevision": -1,
"minorRevision": -1
},
"content": {
"headers": [
{
"key": "Content-Type",
"value": [
"application\/json; charset=utf-8"
]
}
]
},
"statusCode": 400,
"reasonPhrase": "Bad Request",
"headers": [
],
"requestMessage": {
"version": {
"major": 2,
"minor": 0,
"build": -1,
"revision": -1,
"majorRevision": -1,
"minorRevision": -1
},
"content": null,
"method": {
"method": "GET"
},
"requestUri": null,
"headers": [
],
"properties": {
}
},
"isSuccessStatusCode": false
}
It is quite vague as to what the cause of the error is. Is there something wrong with the setup of my queries / types? Or is it in my request? Is it about authentication?
I'm not sure which code to share, so I uploaded my API library at: https://github.com/jonasarcangel/GraphQLIssue
Request payload is as follows (using Apollo Angular):
{
"operationName": "configsQuery",
"variables": {
"id": "",
"module": "admin\/configs",
"name": "canActivate"
},
"query": "query configsQuery($id: String, $module: String, $name: String) {\n configs(id: $id, module: $module, name: $name) {\n id\n createdBy\n createdDate\n updatedBy\n updatedDate\n name\n module\n value\n __typename\n }\n}\n"
}
I have an apache 2.4 server, which serves a file called resource.js.
When I request the resource, it returns an old page. My browser does not send an ETAG or Last-Modified header in the request, presumably because it doesn't have this resource cached.
Here's a snippet of the HAR when this happens
{
"startedDateTime": "2014-04-30T21:01:36.384Z",
"time": 0,
"request": {
"method": "GET",
"url": "https://someserver/resource.js",
"headers": [
{
"name": "User-Agent",
"value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"
}
],
"queryString": [],
"cookies": [],
"headersSize": -1,
"bodySize": 0
},
"response": {
"status": 200,
"statusText": "OK",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Date",
"value": "Wed, 30 Apr 2014 20:46:57 GMT"
},
{
"name": "Last-Modified",
"value": "Thu, 24 Apr 2014 23:42:51 GMT"
},
{
"name": "Server",
"value": "Apache/2.4.4 (Unix) OpenSSL/1.0.1 PHP/5.4.12"
},
{
"name": "ETag",
"value": "\"e00-4f7d2684c7fb9\""
},
{
"name": "Content-Type",
"value": "application/javascript"
},
{
"name": "Connection",
"value": "Keep-Alive"
},
{
"name": "Accept-Ranges",
"value": "bytes"
},
{
"name": "Keep-Alive",
"value": "timeout=5, max=98"
},
{
"name": "Content-Length",
"value": "3584"
}
],
"cookies": [],
"content": {
"size": 3584,
"mimeType": "application/javascript",
"text": "...."
},
"redirectURL": "",
"headersSize": 318,
"bodySize": 0
},
"cache": {},
"timings": {
"blocked": -1,
"dns": -1,
"connect": -1,
"send": 0,
"wait": 0,
"receive": 0,
"ssl": -1
},
"connection": "48540",
"pageref": "page_1"
},
I know it's an old page, because I can verify the content of the page is not what is on the server. Also, note that the response returns an ETAG (that is wrong) and a Last-Modified date that's 7 days old when I modified this file today.
On the subsequent request though, the apache server returns the right page, after the ETAG and Last-Modified headers are submitted as part of the request:
{
"startedDateTime": "2014-04-30T21:03:02.771Z",
"time": 490.7269477844238,
"request": {
"method": "GET",
"url": "https://someserver/resource.js",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Cookie",
"value": "__utma=37592696.1580400495.1393617937.1393617937.1394060568.2; __utmz=37592696.1393617937.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); m=1933:60%7C5|2491:chart|34e2:|4e71:small"
},
{
"name": "Accept-Encoding",
"value": "gzip,deflate,sdch"
},
{
"name": "Host",
"value": "someserver"
},
{
"name": "Accept-Language",
"value": "en-US,en;q=0.8"
},
{
"name": "User-Agent",
"value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"
},
{
"name": "Accept",
"value": "*/*"
},
{
"name": "Cache-Control",
"value": "max-age=0"
},
{
"name": "If-None-Match",
"value": "\"e00-4f7d2684c7fb9\""
},
{
"name": "Connection",
"value": "keep-alive"
},
{
"name": "If-Modified-Since",
"value": "Thu, 24 Apr 2014 23:42:51 GMT"
},
{
"name": "Referer",
"value": "https://someserver"
}
],
"queryString": [],
"cookies": [
{
"name": "__utma",
"value": "37592696.1580400495.1393617937.1393617937.1394060568.2",
"expires": null,
"httpOnly": false,
"secure": false
},
{
"name": "__utmz",
"value": "37592696.1393617937.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)",
"expires": null,
"httpOnly": false,
"secure": false
},
{
"name": "m",
"value": "1933:60%7C5|2491:chart|34e2:|4e71:small",
"expires": null,
"httpOnly": false,
"secure": false
}
],
"headersSize": 667,
"bodySize": 0
},
"response": {
"status": 200,
"statusText": "OK",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Date",
"value": "Wed, 30 Apr 2014 21:03:03 GMT"
},
{
"name": "Last-Modified",
"value": "Wed, 30 Apr 2014 21:01:19 GMT"
},
{
"name": "Server",
"value": "Apache/2.4.4 (Unix) OpenSSL/1.0.1 PHP/5.4.12"
},
{
"name": "ETag",
"value": "\"8bd-4f848d99ceae4\""
},
{
"name": "Content-Type",
"value": "application/javascript"
},
{
"name": "Connection",
"value": "Keep-Alive"
},
{
"name": "Accept-Ranges",
"value": "bytes"
},
{
"name": "Keep-Alive",
"value": "timeout=5, max=100"
},
{
"name": "Content-Length",
"value": "2237"
}
],
"cookies": [],
"content": {
"size": 2237,
"mimeType": "application/javascript",
"compression": 0,
"text": "..."
},
"redirectURL": "",
"headersSize": 321,
"bodySize": 2237
},
"cache": {},
"timings": {
"blocked": 2.418000000034226,
"dns": 69.07200000023295,
"connect": 182.09600000045612,
"send": 0.08100000013655517,
"wait": 235.99800000010873,
"receive": 1.0619477834552526,
"ssl": 181.40800000037416
},
"connection": "49670",
"pageref": "page_2"
},
And as expected, on the 3rd request, the ETAG and Last-Modified are good so the apache server sends back a 304 response code:
{
"startedDateTime": "2014-04-30T21:14:56.248Z",
"time": 138.21721076965332,
"request": {
"method": "GET",
"url": "https://someserver/resource.js",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "If-None-Match",
"value": "\"8bd-4f848d99ceae4\""
},
{
"name": "Accept-Encoding",
"value": "gzip,deflate,sdch"
},
{
"name": "Host",
"value": "someserver"
},
{
"name": "Accept-Language",
"value": "en-US,en;q=0.8"
},
{
"name": "User-Agent",
"value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"
},
{
"name": "Accept",
"value": "*/*"
},
{
"name": "Referer",
"value": "https://someserver"
},
{
"name": "Cookie",
"value": "__utma=37592696.1580400495.1393617937.1393617937.1394060568.2; __utmz=37592696.1393617937.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); m=1933:60%7C5|2491:chart|34e2:|4e71:small"
},
{
"name": "Connection",
"value": "keep-alive"
},
{
"name": "If-Modified-Since",
"value": "Wed, 30 Apr 2014 21:01:19 GMT"
}
],
"queryString": [],
"cookies": [
{
"name": "__utma",
"value": "37592696.1580400495.1393617937.1393617937.1394060568.2",
"expires": null,
"httpOnly": false,
"secure": false
},
{
"name": "__utmz",
"value": "37592696.1393617937.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)",
"expires": null,
"httpOnly": false,
"secure": false
},
{
"name": "m",
"value": "1933:60%7C5|2491:chart|34e2:|4e71:small",
"expires": null,
"httpOnly": false,
"secure": false
}
],
"headersSize": 653,
"bodySize": 0
},
"response": {
"status": 304,
"statusText": "Not Modified",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Date",
"value": "Wed, 30 Apr 2014 21:14:56 GMT"
},
{
"name": "ETag",
"value": "\"8bd-4f848d99ceae4\""
},
{
"name": "Server",
"value": "Apache/2.4.4 (Unix) OpenSSL/1.0.1 PHP/5.4.12"
},
{
"name": "Connection",
"value": "Keep-Alive"
},
{
"name": "Keep-Alive",
"value": "timeout=5, max=100"
}
],
"cookies": [],
"content": {
"size": 2237,
"mimeType": "application/javascript",
"text": "..."
},
"redirectURL": "",
"headersSize": 203,
"bodySize": 0
},
"cache": {},
"timings": {
"blocked": 5.732999999963795,
"dns": -1,
"connect": -1,
"send": 0.07100000038917642,
"wait": 118.89599999994971,
"receive": 13.51721076935064,
"ssl": -1
},
"connection": "51334",
"pageref": "page_1"
},
If anyone knows why the first request returns the wrong page, please let me know.