Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.

Commit

Permalink
FIX: 403 response for httpful default user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel committed Jan 24, 2020
1 parent ae76bb5 commit feea236
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": ["aceproject", "api", "taskmanager"],
"license": "CC-BY-1.0",
"homepage": "https://github.com/millsoft/aceproject",
"version" : "0.12",
"version" : "0.13",
"authors": [
{
"name": "Michael Milawski",
Expand Down
3 changes: 3 additions & 0 deletions src/AceProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public static function getGUID() {


$response = \Httpful\Request::get( $url )
->addHeader('User-Agent', 'millsoft/aceproject')
->expectsJson()
->send();

Expand Down Expand Up @@ -130,6 +131,7 @@ public static function sendRequest( $params, $method = "get" ) {
$url = self::$apiUrl . "/?" . $_p;

$response = \Httpful\Request::$method( $url )
->addHeader('User-Agent', 'millsoft/aceproject')
->expectsJson()
->send();

Expand Down Expand Up @@ -218,6 +220,7 @@ public static function uploadFile( $filePath ) {
);

$request = \Httpful\Request::post( $upload_url );
$request->addHeader('User-Agent', 'millsoft/aceproject');
$request->body( $params );
$request->attach( $payload );

Expand Down
1 change: 1 addition & 0 deletions src/tools/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public static function extractParams( $str ) {
public static function importByUrl( $url ) {

$response = \Httpful\Request::get( $url )
->addHeader('User-Agent', 'millsoft/aceproject')
->send();
$response = str_ireplace( "&amp", "&", $response );

Expand Down

0 comments on commit feea236

Please sign in to comment.