iOS 11.4 only request .well-known/apple-app-site-association - ios

My app's associated domain does't work ant iOS 11.4 and iOS 12 beta. After some research I found that after iOS 11.4 only request /.well-known/apple-app-site-association when server response with 301 redirect to error.html.
"GET /.well-known/apple-app-site-association HTTP/1.1" 301 194 "-" "swcd (unknown version) CFNetwork/948.2.1 Darwin/18.0.0"
"GET /.well-known/apple-app-site-association HTTP/1.1" 301 194 "-" "swcd (unknown version) CFNetwork/948.2.1 Darwin/18.0.0"
Before iOS 11.4, iOS will request /apple-app-site-association when /.well-known/apple-app-site-association failed, and log is like this:
"GET /.well-known/apple-app-site-association HTTP/1.1" 301 194 "-" "swcd (unknown version) CFNetwork/948.2.1 Darwin/18.0.0"
"GET /apple-app-site-association HTTP/1.1" 200 466 "-" "swcd (unknown version) CFNetwork/948.2.1 Darwin/18.0.0"
Does anyone know is this a bug on iOS 11.4 or a new restrict about 301 redirect?

Related

got 301 and then 404 error response while calling end point in odoo15

here is my code:
from odoo import http
_logger = logging.getLogger(__name__)
class CrmController(http.Controller):
#http.route('/crm/lead', type='json', auth='none', website=True, methods=['POST'])
def post_data_end_point(self):
print("==== api called successfully ====")
return "api called successfully---"
after call this end point on postman i got this error
2022-09-14 09:44:09,925 167674 INFO odoo15 werkzeug: 127.0.0.1 - - [14/Sep/2022 09:44:09] "POST /crm/lead/ HTTP/1.1" 301 - 35 0.020 0.817
2022-09-14 09:44:10,421 167674 INFO odoo15 werkzeug: 127.0.0.1 - - [14/Sep/2022 09:44:10] "GET /crm/lead HTTP/1.1" 404 - 214 0.116 0.357
you have define type='json' it means it response only json(dictionary) object not string.

Flasgger execution is a success but not showing the XML body

While Deploying iris prediction model using flasgger API, i can enter the lengths and widths of the iris flower with http/200 ok , but i do not see an xml output with the prediction results.
From ipython notebook:
Running on http://127.0.0.1:5001/ (Press CTRL+C to quit)
127.0.0.1 - - [20/Jan/2020 17:16:23] "GET /predict?s_length=3.2&s_width=2.0&p_length=3.0&p_width=4.5 HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:23] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [20/Jan/2020 17:16:47] "GET /apidocs/ HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:47] "GET /flasgger_static/swagger-ui.css HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:47] "GET /flasgger_static/swagger-ui-bundle.js HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:47] "GET /flasgger_static/swagger-ui-standalone-preset.js HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:48] "GET /flasgger_static/lib/jquery.min.js HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:48] "GET /apispec_1.json HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:48] "GET /flasgger_static/favicon-32x32.png HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:17:03] "GET /predict?s_length=4.2&s_width=5.6&p_length=2.6&p_width=6.3 HTTP/1.1" 200 -
Hope you all are keeping well.
So i found the problem after few days of struggling with it, looking for solution ,I guess i was too lazy to post it on GitHub or maybe got busy , the error indicated above was a result of incomplete XML missing 200 body for an HTTP Response , which did not output any XML Result when I entered the input parameters and run the prediction from the GUI , which is expected in my case.
So it is important that we provide a complete XML body with 200 response , we can also add the kind of results you would expect under the 200 XML Body for the prediction based on your Project.
Adding the 200 in the XML body as shown below, fixed the problem.
def predict_iris_file():
"""Example file endpoint returning a prediction of iris
---
parameters:
- name: input_file
in: formData
type: file
required: true
responses:
200:
description: "0: Iris-setosa, 1: Iris-versicolor, 2: Iris-virginica"
"""
Regards
akudnaver
Sorted the issue.
Responses should be in the same indent as parameters and 200 should be indented below responses

Tests failing because of a 500 internal server error

[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/ng-file-upload-shim.min.js HTTP/1.1" 200 bytesIn:568 bytesOut:3062 reqTime:0
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/ng-file-upload-all.min.js HTTP/1.1" 200 14565 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/ngBootbox.min.js HTTP/1.1" 200 1407 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/bootbox.min.js HTTP/1.1" 200 4166 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/ngBootbox.min.js HTTP/1.1" 200 bytesIn:557 bytesOut:1407 reqTime:0
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/bootbox.min.js HTTP/1.1" 200 bytesIn:556 bytesOut:4166 reqTime:0
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/ng-file-upload-all.min.js HTTP/1.1" 200 bytesIn:567 bytesOut:14565 reqTime:0
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/moment.min.js HTTP/1.1" 200 20933 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/angular-moment.min.js HTTP/1.1" 200 2281 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/moment-locale-en-gb.js HTTP/1.1" 200 1385 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/smart-table/smart-table.min.js HTTP/1.1" 200 2902 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/lrStickyHeader.js HTTP/1.1" 200 1905 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/lrStickyHeader.js HTTP/1.1" 200 bytesIn:559 bytesOut:1905 reqTime:0
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/moment-locale-en-gb.js HTTP/1.1" 200 bytesIn:563 bytesOut:1385 reqTime:0
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/angular-moment.min.js HTTP/1.1" 200 bytesIn:563 bytesOut:2281 reqTime:0
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/smart-table/smart-table.min.js HTTP/1.1" 200 bytesIn:572 bytesOut:2902 reqTime:0
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/moment.min.js HTTP/1.1" 200 bytesIn:555 bytesOut:20933 reqTime:0
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/stStickyHeader.js HTTP/1.1" 200 816 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/stStickyHeader.js HTTP/1.1" 200 bytesIn:558 bytesOut:816 reqTime:0
[php-fpm:access] 127.0.0.1 - 13/Sep/2019:14:02:09 +0000 "GET /index.php?compDur=0+DAY&getKids=none&open=0&team=50&type=team" 200 /var/www/secure.curtisbanks.co.uk/htdocs/index.php 323.680 8192 30.89%
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /tasks/tasksApi/tasks?compDur=0+DAY&getKids=none&open=0&team=50&type=team HTTP/1.1" 200 57634 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /tasks/tasksApi/tasks?compDur=0+DAY&getKids=none&open=0&team=50&type=team HTTP/1.1" 200 bytesIn:587 bytesOut:576
So I have my tests running each morning at 3 AM aprox. I have some tests that are failing with the same error which is:
03:12:18.785 WARNING - http://servertest/user/account/login - This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see https://goo.
03:12:53.997 WARNING - http://servertest/user/account/login - This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see https://goo.
03:13:18.146 SEVERE - http://servertest/portal/messages/team/id/46/view/onldgdl7g7SrCYl93uyGVFon1yfJP6OGpRpyiJmpQUYuoXKk - [DOM] Found 2 elements with non-unique id #undefined_hint: (More info: https://goo) %o %o
03:13:25.395 SEVERE - http://servertest/portal/messages/exportForKW/ref/onldgdl7g7SrCYl93uyGVFon1yfJP6OGpRpyiJmpQUYuoXKk/ajax/1 - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
I have tried to change the id's where is it filling the user name and password as I can see on the screenshot that the last part of the password is sometimes filled in the username filed, after the user name was already filled in.
$I = new AcceptanceTester($scenario);
$I->wantTo('Search for a caller, go through security, save it and add notes');
//Log in
$I->amOnPage('/user/account/login');
$I->fillField("UserLogin[username]", "");
$I->fillField("UserLogin[password]", "");
$I->click('Log In');
$I->wait(2);
$I->waitForElementVisible('#AdminMemberGrid_status', 30);
//Access the call tab
$I->click('//*[#id="secondaryMenu"]/li[1]/a');
$I->waitForText('Search for caller :');
Here the popup where I wait for text search for caller and pick up transferred call is not visible, in the screenshot it barley appears in front of the first page when I click the Call tab $I->click('//*[#id="secondaryMenu"]/li[1]/a');
I am expecting to see the text and fill the fields, adding a longer wait won't make any difference.
The other tests pass, and they have the same code.
Clicking on the google links will redirect me to the security blog, online google security blog: 2016/09/moving-towards-more-secure-web.html
09:39:55.676 WARNING - http://servertest/user/account/login - This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see
09:41:09.738 SEVERE - http://servertest/nii/index/show/id/144904/type/40x40.max - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
09:41:10.182 SEVERE - http://servertest/nii/index/show/id/144904/type/40x40.max - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
09:41:22.316 SEVERE - http://servertest/nii/index/show/id/144904/type/40x40.max - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
09:41:42.15 SEVERE - http://servertest/nii/index/show/id/144904/type/40x40.max - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
09:42:12.869 SEVERE - http://servertest/nii/index/show/id/144904/type/40x40.max - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
09:42:29.88 WARNING - http://servertest/user/account/login - This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see
09:43:04.33 WARNING - http://servertest/user/account/login - This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see
09:43:30.640 SEVERE - - [DOM] Found 2 elements with non-unique id #undefined_hint: (More info: ) %o %o

react native map issue

My app gives me error when I import MapView on react nativ
Here is my code:
`import MapView from 'react-native-maps'`
just importing it like that gives me an erorr
Here is my dpendency:
"dependencies": {
"react": "16.6.1",
"react-native": "0.57.7",
"react-native-maps": "^0.22.1",
"react-native-router-flux": "^4.0.6"
},
Opening /Users/Desktop/snl/reactNative/ChatApp/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js with /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl
BUNDLE [ios, dev] ../../index.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (1/1), done.
BUNDLE [ios, dev] ../../index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1)::1 - - [09/Dec/2018:08:42:21 +0000] "GET /index.bundle?platform=ios&dev=true&minify=false HTTP/1.1" 200 - "-" "ChatApp/1 CFNetwork/975.0.3 Darwin/17.7.0"
::1 - - [09/Dec/2018:08:42:24 +0000] "POST /symbolicate HTTP/1.1" 200 - "-" "ChatApp/1 CFNetwork/975.0.3 Darwin/17.7.0"
::1 - - [09/Dec/2018:08:42:25 +0000] "POST /symbolicate HTTP/1.1" 200 - "-" "ChatApp/1 CFNetwork/975.0.3 Darwin/17.7.0"
^[[1;2D

nginx redirects POST requests to GET request

I have Rails 4.1 application with runs on puma web server. I use nginx as a proxy server. Several days ago everything worked very well. I updated my application, and suddenly some POST requests started to redirected to same url but as GET request. I've tried rollback to previous working versions, no success.
I found very interesting behaviour. I tested my API with curl.
If I did POST request to the url
http://myapp.com/tasks/easy_task/calculate/ it redirects to same url
but as GET request.
Then I did POSTrequest to http://myapp.com/, returned 404
Then I did POSTrequest to http://myapp.com/tasks, returned 404
Then I did POSTrequest to http://myapp.com/tasks/easy_task, returned 404
Then I did POSTrequest to http://myapp.com/tasks/easy_task/calculate, returned 200. YAY!
Same thing happened when I used chrome's app Postman. First it redirected, but after previous steps it works well.
I use this app in my other application. I use RestClient to make http requests. When I try to make POST request it raises an exception RestClient::MovedPermanently (301 Moved Permanently).
I reinstalled nginx to 1.7.3.
Restarted server (virtual machine)
re deployed my app, deployed previous versions
no success :(
I found similar questions on stackoverflow, but non of them gave me clue to fix this issue. I hope you can help me to solve this problem. Thanks in advance!
Similar questions:
- POST request turns into GET request
- POST request mysteriously turn into GET request
nginx config:
$ cat /etc/nginx/sites-enabled/myapp.com.conf
# The file generated by Chef for mycompany
upstream myapp_mycompany_com {
server unix:/tmp/myapp.com-puma.sock;
}
server {
server_name myapp.com;
listen 80;
access_log /var/log/nginx/myapp.com-access.log;
error_log /var/log/nginx/myapp.com-error.log;
root /home/projects/mycompany/myapp.com/current/public;
gzip on;
gzip_types text/plain text/xml application/xml application/xml+rss
text/css text/javascript application/javascript application/json;
error_page 551 =503 #maintenance;
location #maintenance {
rewrite ^(.*)$ /system/maintenance.html break;
}
set $maintenance 0;
if (-f $document_root/system/maintenance.html) {
set $maintenance 1;
}
if ($request_uri = /favicon.ico) {
# Browsers will try to get favicon if it's not returned with 200ok status
set $maintenance 0;
}
if ($maintenance) {
# There can be several reasons for 503 error. We custom return 551 error
# to ensure maintenance.html is only shown when it's really maintenance
return 551;
}
rewrite ^/(.*)/$ /$1 permanent; # Truncate trailing slashes
try_files $uri #rails;
expires -1;
location = /favicon.ico {
try_files $uri =204;
access_log off;
log_not_found off;
}
location #rails {
proxy_pass http://myapp_mycompany_com;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_intercept_errors on;
expires -1;
}
error_page 500 502 503 504 /500.html;
error_page 403 /403.html;
error_page 404 /404.html;
client_max_body_size 50M;
keepalive_timeout 10;
}
Puma
$ bundle exec puma -d -e production -b unix:///tmp/myapp.com-puma.sock --pidfile /home/projects/mycompany/myapp.com/shared/tmp/pids/puma.pid
$
Example of access.log
123.123.123.123 - - [11/Jul/2014:05:44:17 +0000] "POST /tasks/easy_task/calculate/ HTTP/1.1" 301 184 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2073.0 Safari/537.36"
123.123.123.123 - - [11/Jul/2014:05:44:17 +0000] "GET /tasks/easy_task/calculate HTTP/1.1" 404 713 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2073.0 Safari/537.36"
...
123.123.123.123 - - [11/Jul/2014:06:04:17 +0000] "POST / HTTP/1.1" 404 713 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2073.0 Safari/537.36"
123.123.123.123 - - [11/Jul/2014:06:04:26 +0000] "POST /tasks HTTP/1.1" 404 713 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2073.0 Safari/537.36"
123.123.123.123 - - [11/Jul/2014:06:04:36 +0000] "POST /tasks/easy_task HTTP/1.1" 404 713 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2073.0 Safari/537.36"
123.123.123.123 - - [11/Jul/2014:06:04:42 +0000] "POST /tasks/easy_task/calculate HTTP/1.1" 200 104 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2073.0 Safari/537.36"
TL;DR
If you want to completely redirect to a new resource and method and body of the requests should not be changed use 308 instead of 301 or 302.
301 is permanent redirect but 302 is temporary so search engines don't change urls associated with that website when 302 is used.
301 and 302 indicated method and body should not be altered, but not all user agents align with that. Read this explanation from Mozilla:
The HyperText Transfer Protocol (HTTP) 302 Found redirect status response code indicates that the resource requested has been temporarily moved to the URL given by the Location header. A browser redirects to this page but search engines don't update their links to the resource (in 'SEO-speak', it is said that the 'link-juice' is not sent to the new URL). Even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents conform here - you can still find this type of bugged software out there. It is therefore recommended to set the 302 code only as a response for GET or HEAD methods and to use 307 Temporary Redirect instead, as the method change is explicitly prohibited in that case. In the cases where you want the method used to be changed to GET, use 303 See Other instead. This is useful when you want to give a response to a PUT method that is not the uploaded resource but a confirmation message such as: 'you successfully uploaded XYZ'.
308 and 307 both permanently redirect to a new resource but they guarantee body and method of request won't be altered. the difference is that 308 is permanent and 307 is temporary, so 308 will signal search engines to change urls. see this:
The only difference between 307 and 302 is that 307 guarantees that the method and the body will not be changed when the redirected request is made. With 302, some old clients were incorrectly changing the method to GET: the behavior with non-GET methods and 302 is then unpredictable on the Web, whereas the behavior with 307 is predictable. For GET requests, their behavior is identical.
I've found solution. When I did POST request, I used url which ends with slash, like http://myapp.com/tasks/easy_task/calculate/
When I used url without slash in the end, like http://myapp.com/tasks/easy_task/calculate everything works perfectly!
I think it is because of this rule
rewrite ^/(.*)/$ /$1 permanent; # Truncate trailing slashes
I am closing this issue. Tomorrow.
In my case, the redirect meant if I POST to http://... the proxy_pass is converted to a GET.
Change the URL to an https://... and it is passed on as a POST as intended.
location /dc1 {
proxy_pass http://localhost:8000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host www.example.com;
}

Resources