Categories
Mastering Development

I can not log in to the site through curl

I can’t understand what I’m doing wrong. There is a service site: https://demo.moneta.ru/login.htm. The usual form with a token. I knock on the page, save the cookies, take the token from the form. The next request I send to the address from the form data. With cookies and token. I get a fig. 401. I […]

Categories
Development

Python socket – downloading files only work in chrome

So I created a code which a client uploads a file to the server folder and he has an option to download it back, it works perfectly fine in chrome, I click on the item I want to download and it downloads it def send_image(request, cs): request = request.split(‘=’) try: name = request[1] except: name […]

Categories
Development

Incomplete response for XHR request in python with requests.post()

I am trying to scrape German zip codes (PLZ) for a given street in a given city using Python’s requests on this server. I am trying to apply what I learned here. I want to return the PLZ of Schanzäckerstr. in Nürnberg. import requests url = https://www.postdirekt.de/plzserver/PlzAjaxServlet data = ‘plz_city=n%C3%BCrnberg&plz_plz=&plz_city_clear=&plz_district=&finda=plz&plz_street=Schanz%C3%A4ckerstr.+2&lang=de_DE’ headers = {“Host”: “www.postdirekt.de”, “User-Agent”: […]

Categories
Development

Jquery Ajax doesn’t send authorization header

I try to make basic authentication with Jquery Ajax. I add authorization header to ajax request like this. $.ajax({ headers: { “authorization”: “basic 123456”, }, crossDomain: true, type: “POST”, contentType: “application/json; charset=utf-8”, url: ‘http://example.com/Auth.asmx/Authorization’, data: null, dataType: “jsonp”, success: function (data, status) { console.log(“Success”); console.log(data); }, error: function (xmlRequest) { console.log(“Error”); console.log(xmlRequest); } }); Then […]

Categories
Development

No response for XHR request in python with requests.get()

I want to scrape german poll data from a server. Here, I search for an examplary street, straße “Judengasse”. I have been trying to reproduce this. Unfortunately, the link from the reference is not intact anymore, so I couldn’t directly compare it to my problem. Since I am fairly inexperienced, I do not know what […]

Categories
Development System & Network

firefox throws CORS but works fine in chrome

I have set the following in apache RequestHeader edit “If-None-Match” ‘^”((.*)-(gzip|br))”$’ ‘”$1″, “$2″‘ SetEnvIf Origin “^http(s)?:\/\/(.+\.)?(iac-dev-ci\.shared\.sp\.domain\.com|bsi\.domain\.com)$” AccessControlAllowOrigin=$0 Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin Header always set Access-Control-Allow-Credentials: true env=AccessControlAllowOrigin Header always set Access-Control-Allow-Methods: “GET, POST, OPTIONS” env=AccessControlAllowOrigin Header always set Access-Control-Allow-Headers: “Authorization” env=AccessControlAllowOrigin <Directory /var/SP/httpd/${INSTANCE}/${INSTANCE}.domain.com/docs> <LimitExcept GET POST HEAD> Require all denied </LimitExcept> Options FollowSymLinks […]

Categories
CMS Development Wordpress

async_upload.php 500 Error when Uploading larger files with slow internet connection and latency

my page runs on a local corporate network on a Windows 2016 server running IIS 10. PHP 7.1 WordPress 5.3 The page is used as a video platform. Videos up to 2GB can be uploaded. From our locations on the same network (upload speed 25-50Mbps) the upload works without any problems. The corresponding parameters in […]

Categories
API Development React

Symfony API, Reactjs and Nginx: No ‘Access-Control-Allow-Origin’ header is present on the requested resource in production

I have two app running on nginx server: My Symfony API: https://dev-api******.com and my React App: https://dev-front******.com I’m using a jwt authentication but i’m not able to connect to my API because of cors policy. It’s also not working with nelmio cors bundle but there is no problem with Postman. My nelmio cors config: nelmio_cors: […]

Categories
Chrome Development PHP XML

Difference between command line cURL and PHP cURL

I have a cURL command like this: curl ‘https://www.11880.com’ -H ‘user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36’ -H ‘accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3’ -H ‘accept-language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7’ -H ‘authority: www.11880.com’ Executing this in a command line like in Terminal app on my Mac, results to the expected output. (In case you test […]

Categories
Chrome Development PHP XML

Difference between command line cURL and PHP cURL

I have a cURL command like this: curl ‘https://www.11880.com’ -H ‘user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36’ -H ‘accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3’ -H ‘accept-language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7’ Executing this in a command line, like in Terminal app on my Mac, results to the expected output. I transferred the exact command to PHP […]